For Example, Table with three cols and data
col1 col2 col3
10 20 30
40 50 60
40 50 80
Want to do a select where for the last two rows only returns one since col1 and col2 are the same.
select distinct will not work since col3 are different.
so output would be
10 20 30
40 50 xx (don't care)
As you only have one additional column you can just use an arbitrary
MIN/MAXaggregate andGROUP BYMore generally if your RDBMS supports analytic functions you can use