当前位置: 代码迷 >> 其他数据库 >> 请问SQLITE怎么删除表内重复的记录
  详细解决方案

请问SQLITE怎么删除表内重复的记录

热度:1042   发布时间:2013-02-26 00:00:00.0
【求助】请教SQLITE如何删除表内重复的记录
表如下
SID TIT
10001 hello1
10002 hello2
10002 hello3
10003 hello4

执行后的效果

SID TIT
10001 hello1
10002 hello2
10003 hello4

SQLSERVER的代码用不上,

请教各位前辈 SQLITE代码要怎么写?

------解决方案--------------------------------------------------------
SQL code
sqlite> select * from Yookey;sid|tit10001|hello110002|hello210002|hello310003|hello4sqlite>sqlite> delete from Yookey where tit not in (select min(tit) from Yookey group by SID);sqlite> select * from Yookey;sid|tit10001|hello110002|hello210003|hello4sqlite>
  相关解决方案