表如下
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|tit 10001|hello1 10002|hello2 10002|hello3 10003|hello4 sqlite> sqlite> delete from Yookey where tit not in (select min(tit) from Yookey group b y SID); sqlite> select * from Yookey; sid|tit 10001|hello1 10002|hello2 10003|hello4 sqlite>