data in table 'TEST':
column01, column02, column03
ACB, ACB, ACB
BAC, AAA, BAC
You can see that values of the column 'column02' are the same for the first row and the fourth row. They are both 'AAA'.
I would like to find out which value is duplicated in a certain column by executing a SQL select query. is this possible?
You culd do something like,
select A.* from myTable A, myTable B
where A.col1 = B.col1 or A.col2 = B.col2 or A.col3 = B.col3
Note: I haven't tested how good it performs
I should have made my question more clear. Actually what I wanted to do is a query like
select a.column02 from TEST a, TEST b where a.column02 != b.column02 and a.column03 = a.column03
i just realized that it is not that complicated as i thought since the value of column03 is has to be distinct, but thanks anyway.
Click Here to Expand Forum to Full Width