Created
December 19, 2014 01:51
-
-
Save mingcheng/835238415f94c2c35285 to your computer and use it in GitHub Desktop.
SQLite 获取和删除重复的数据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 获取重复的数据 | |
| select title, id, count(*) as count from eslpod group by title having count(*) > 1; | |
| # 删除重复的数据,其中 rowid 为 sqlite 自带字段 | |
| delete from eslpod where eslpod.rowid not in (select max(eslpod.rowid) from eslpod group by | |
| title); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment