I have a table with 3 columns as below:
one | two | three | name
------------------------------------
A1 B1 C1 xyz
A1 B1 C1 pqr -> should be deleted
A1 B1 C1 lmn -> should be deleted
A2 B2 C2 abc
A2 B2 C2 def -> should be deleted
A3 B3 C3 ghi
------------------------------------
The table is not having any primary key column. I do not have any control over the table and so I can not add any primary key column.
As shown, I want to delete the rows where the combination of one, two and three column is same. So if A1B1C1 is occurring thrice (as in above e.g.), the other two should be deleted and only one should stay.
How to achieve this through just one query in DB2 ?
My requirement is for a single query as I would be running it through a java program.