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
Post a Comment