开发者

SQL: How to find Duplicate values in a large table

开发者_C百科I have a table of about 2 million SKU's. Is there a way to detect any sku that occurs more than once by running a select query??


Select SKU
From table
Group By SKU
Having Count(SKU) > 1


 SELECT SKUColumn, COUNT(*) FROM YourTable
    GROUP BY SKUColumn HAVING COUNT(*) > 1


select SKU, count(SKU) cnt from table group by SKU having cnt > 1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜