I have a following table:
col1 | col2 |
---|---|
one | a |
two | a |
333 | b |
323 | b |
How do I get for each distinct value present in col2 only 1 corresponding value in col1 lie the following:
col1 | col2 |
---|---|
one | a |
323 | b |
CodePudding user response:
select col2,min(col1)x
from your_table
group by col2;