表如下
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>