开发者

sql (query) checking for duplicate record on duplicate columns

开发者 https://www.devze.com 2023-03-29 03:16 出处:网络
ok this is my data in the table field1field2field 3field4 10702011-01-01 00:00:00.0002613 10702011-01-01 00:00:00.0002613

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

精彩评论

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

关注公众号