{"id":461,"date":"2013-02-06T16:14:01","date_gmt":"2013-02-06T21:14:01","guid":{"rendered":"https:\/\/mkncreations.com\/site\/?p=461"},"modified":"2015-11-12T11:48:22","modified_gmt":"2015-11-12T16:48:22","slug":"tsql-find-duplicate-records-from-a-table","status":"publish","type":"post","link":"https:\/\/mkncreations.com\/site\/2013\/02\/tsql-find-duplicate-records-from-a-table\/","title":{"rendered":"TSQL &#8211; Find Duplicate Records from a Table"},"content":{"rendered":"<blockquote><p>SELECT ID<\/p>\n<p>FROM yourTable<\/p>\n<p>GROUP BY ID<\/p>\n<p>HAVING (COUNT(ID) > 1)\n<\/p><\/blockquote>\n<p>In SQL 2005+ you can do the following and get all of the columns:<\/p>\n<blockquote><p>SELECT *<br \/>\n, ROW_NUMBER() OVER (PARTITION BY col1, col2, col3 ORDER BY (SELECT 0)) AS DuplicateRowNumber<\/p>\n<p>FROM yourTable<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>SELECT ID FROM yourTable GROUP BY ID HAVING (COUNT(ID) > 1) In SQL 2005+ you can do the following and get all of the columns:&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12],"tags":[102,101,97,99,98,100,50,49],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-how_to","category-sql","tag-database","tag-db","tag-duplicate","tag-find","tag-records","tag-select","tag-sql-2","tag-tsql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/posts\/461"}],"collection":[{"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":4,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":322994,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/posts\/461\/revisions\/322994"}],"wp:attachment":[{"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mkncreations.com\/site\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}