This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Help! there are thondands records in a table, two records have duplicate "id", how can i find them use SQL?
-fxiao(风 风而已);
2003-7-15
(#1287424@0)
-
try thisSELECT id, COUNT(id) AS NumberOfDups
FROM a
GROUP BY id
HAVING (COUNT(id) > 1)
-zxcvb(朝天椒);
2003-7-15
{98}
(#1287447@0)
-
I got it, thank you very much!use my own way:
SELECT COUNT(Invoice.id), Invoice.id;
FROM invoice;
GROUP BY Invoice.id;
ORDER BY 1
Thank you!
-fxiao(风 风而已);
2003-7-15
{122}
(#1287462@0)