Click here to Skip to main content
15,303,572 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have one table that contain more than 15 columns,in that only two column having repeated values i want to dlete that repeated value based on that two columns...

Source data (copied from comments)
name srno rowid subfrom subto
ash 1 1 sa01 sa02
ash 1 2 sa01 sa03
ash 1 3 sa01 sa43
ash 1 4 sa01 sa02
ash 1 5 sa01 sa07
ash 1 6 sa01 sa02
raj 1 1 sa02 sa17
raj 1 2 sa02 sa89
raj 1 3 sa02 sa17
raj 1 4 sa02 sa02
raj 1 5 sa02 sa90
raj 1 6 sa02 sa89
Posted
Updated 13-May-15 1:26am
v2
Comments
Tomas Takac 13-May-15 7:05am
   
And what should happen to the other columns? I would be better if you provide a sample of your inputs and expected outputs.
Member 11337367 13-May-15 7:14am
   
name srno rowid subfrom subto
ash 1 1 sa01 sa02
ash 1 2 sa01 sa03
ash 1 3 sa01 sa43
ash 1 4 sa01 sa02
ash 1 5 sa01 sa07
ash 1 6 sa01 sa02
raj 1 1 sa02 sa17
raj 1 2 sa02 sa89
raj 1 3 sa02 sa17
raj 1 4 sa02 sa02
raj 1 5 sa02 sa90
raj 1 6 sa02 sa89
Member 11337367 13-May-15 7:15am
   
here subto column code and sub from column code should not to come for more than one times..
Maciej Los 13-May-15 7:20am
   
Based on what condition?
Member 11337367 13-May-15 7:18am
   
i have just given two name ,but it is there for so many people
Tomas Takac 13-May-15 7:27am
   
You should have updated your question, not post it in a comment. I did it for you. Now update the question with your expected results i.e. what is the resultset you wanna get in the end.
MohamedEliyas 13-May-15 7:06am
   
select distinct column name tbl_name
King Fisher 13-May-15 7:06am
   
show some sample records for easy help.
_Asif_ 13-May-15 7:07am
   
What have you tried?

1 solution

IF U are using Oracle then use rowid for distinguishing them.
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900