首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

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

2012-02-07 
【求助】请教SQLITE如何删除表内重复的记录表如下SIDTIT10001hello110002hello210002hello310003hello4执行

【求助】请教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> 

热点排行