hi
what is the query to fetch duplicate records in oracle table.

Re: query to fetch duplicate records 80 80

I think it's the same with SQL:

select field1 ,count(*) from table
group by field1
having count(*) > 1 

or

select * from table
where field1 in 
(select field1 from table
 group by field1
 having count(*) > 1 )
Re: query to fetch duplicate records 80 80

What exactly you mean by duplicate records.

Duplicate based on what ?

Re: query to fetch duplicate records 80 80

select <column_name>,count(*) from <table_name> group by <column_name> having count<column_name> >1

Re: query to fetch duplicate records 80 80

If you wanna fetch and check through the duplicates, you'd gotta use a cursor.

Re: query to fetch duplicate records 80 80

@SQLpower: Why?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.