Hi friends,
Step1-
create table duplicate
(
intId int, varName varchar(50)
)
insert into duplicate(intId ,varName) values(1,'rajes h')
insert into duplicate(intId ,varName) values(2,'raj12 ')
insert into duplicate(intId ,varName) values(1,'rajes h')
insert into duplicate(intId ,varName) values(2,'raj12 ')
insert into duplicate(intId ,varName) values(3,'raj12 ')
Step2-
---Create Duplicate table
create table #dupTbl
(
intId int, varName varchar(50)
)
insert into #dupTbl
select intId,varName from duplicate group by intId,varName having count(*) > 1
Step3-
delete from duplicate where intId in (select intId from #dupTbl)
Step4-
insert into duplicate
select intId,varName from #dupTbl
Finished....... ........
You can checked your table...
Step1-
create table duplicate
(
intId int, varName varchar(50)
)
insert into duplicate(intId ,varName) values(1,'rajes h')
insert into duplicate(intId ,varName) values(2,'raj12 ')
insert into duplicate(intId ,varName) values(1,'rajes h')
insert into duplicate(intId ,varName) values(2,'raj12 ')
insert into duplicate(intId ,varName) values(3,'raj12 ')
Step2-
---Create Duplicate table
create table #dupTbl
(
intId int, varName varchar(50)
)
insert into #dupTbl
select intId,varName from duplicate group by intId,varName having count(*) > 1
Step3-
delete from duplicate where intId in (select intId from #dupTbl)
Step4-
insert into duplicate
select intId,varName from #dupTbl
Finished....... ........
You can checked your table...
Comment