Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Find duplicate values in a table based on combination of two columns.

user555994Apr 23 2008 — edited Apr 23 2008
In table which have millions of records -
I have a Table B under Schema A and i have to find the duplicate records in a table. My Table B uses the combination of columns to identify the unique values.
Scenario is something like this-
One SV_Id can have multiple SV_Details_Id and i have to find out if there is any duplicate in the table. (I have to use combination of columns to identify the unique values and there is no Primary Key, Foreign Key or Unique Key on the table)

then wrote the following query -
select SV_Id,SV_Details_Id count (*) from SchemaA.TableB group by SV_Id,SV_Details_Id having Count (*) > 1 ;

Is it correct as after firing the above query it is returning the rows which is not matching to the duplicate.

kindly help me.
Looking forward for some guidance -
Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2008
Added on Apr 23 2008
2 comments
4,121 views