我在sql 2008寫的代碼,出錯了要怎么改?
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
舉報
2016-07-18
給聚合函數count(*)取個別名就可以了, delete ……join (……count(*) as num? from ……)……
2016-05-09