我在sql 2008寫的代碼,出錯(cuò)了要怎么改?
delete a from tb1 a join?(select name,count(*) from tb1 group by name having COUNT (*)>1) b on a.name=b.name where a.ID<b.ID;
delete a from tb1 a join?(select name,count(*) from tb1 group by name having COUNT (*)>1) b on a.name=b.name where a.ID<b.ID;
2016-05-09
舉報(bào)
2016-07-18
給聚合函數(shù)count(*)取個(gè)別名就可以了, delete ……join (……count(*) as num? from ……)……
2016-05-09