Home » RDBMS Server » Server Administration » finding duplicate values in a column
finding duplicate values in a column [message #372229] Fri, 19 January 2001 14:19 Go to next message
meena
Messages: 36
Registered: December 2000
Member
Hi,

I have a table with column A.

Column A has duplicate values like ,
1
2
3
4
4
4
5
6
6
7..... etc.

How can I select just the duplicate values in column A? In the case of the above example, how do I select
4
4
4
6
6?

Thanks!
Meena
Re: finding duplicate values in a column [message #372230 is a reply to message #372229] Fri, 19 January 2001 14:31 Go to previous messageGo to next message
Paul
Messages: 164
Registered: April 1999
Senior Member
select columnA, count(columnA)
from tablename
group by columnA
having count(columnA) > 1
Re: finding duplicate values in a column [message #372234 is a reply to message #372229] Sat, 20 January 2001 04:48 Go to previous message
Mahesh
Messages: 90
Registered: January 2001
Member
Hi,
Try this .
select *
from table1 a
where rowid>(select min(rowid)
from table1
where column1=a.column1)
OR
select column1,count(*)
from table1
group by column1
having count(*)>1
Previous Topic: SQL Loader
Next Topic: Trigger insuring parent records inserted before progeny
Goto Forum:
  


Current Time: Mon Dec 23 00:47:14 CST 2024