开发者

sql (query) checking for duplicate record on duplicate columns

ok this is my data in the table

field1  field2   field 3                    field4
107     0        2011-01-01 00:00:00.000    2613
107     0        2011-01-01 00:00:00.000    2613        

how can i check for all the duplicate records in开发者_如何学Go the table with this dataset in the query.


select field1, field2, field3, field4, count(*)
from mytable
group by 1,2,3,4
having count(*) > 1;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜