sql server - Map columns to its ID using TSQL -


i have query gets duplicate records in table. see below:

select column1, column2 table1 group  column1, column2 having count(column1 +  column2) > 1 

now, need map column1 , column2 table id, can't incorporate in query above. i'm using tsql, how do this?

this code worked ids:

select id table1 inner join (     select column1, column2     table1     group  column1, column2     having count(column1 +  column2) > 1 ) thistable on table1.column1= thistable.column1and  table1.column2= thistable.column2 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -