Home » RDBMS Server » Server Administration » how to find
how to find [message #375139] Mon, 30 July 2001 23:07 Go to next message
Deep
Messages: 15
Registered: July 2001
Junior Member
i have to take a report in which i want to display only the rows (should include all columns) which are duplicate.
any help is appreciated.
Re: how to find [message #375140 is a reply to message #375139] Mon, 30 July 2001 23:27 Go to previous messageGo to next message
Norvin
Messages: 22
Registered: July 2001
Junior Member
hi, try this:

select * from tableA
where fieldX in ( select fieldX from tableA
group by fieldX
having count(fieldX) = 2);

fieldX - column you want to check if duplicate.
Re: how to find [message #375141 is a reply to message #375139] Tue, 31 July 2001 03:23 Go to previous messageGo to next message
Deep
Messages: 15
Registered: July 2001
Junior Member
select * from table1
where fieldname in
(select fieldname from table1
group by fieldname
heving count(*)>1;
Re: how to find [message #375142 is a reply to message #375139] Tue, 31 July 2001 03:23 Go to previous message
Deep
Messages: 15
Registered: July 2001
Junior Member
select * from table1
where fieldname in
(select fieldname from table1
group by fieldname
heving count(*)>1;
Previous Topic: How to display full procedure body of triggers?
Next Topic: top-N query
Goto Forum:
  


Current Time: Tue Dec 24 06:36:50 CST 2024