这条语句有什么错误啊?
我是删除数据库里 有某些字段相同的记录只保留一个,这样怎么做?
DELETE FROM aFROM TollData AS a CROSS JOIN aWHERE EXISTS (SELECT 1 AS Expr1 FROM TollData WHERE (CardID = a.CardID) AND (StCardDate = a.starddate) AND (Balance = a.Balance))
delete from a where id not in (select max(id) from a group by CardID,StCardDate ,Balance )