Mysql Select distinct value from one column when selecting from two columns
Posted on 2012-03-11
I am using perl to script against mysql. I want to select two columns from a table and make sure that the only columns are returned that have distinct values in one of the columns.
select distinc column1, column2 from table;
This will return a distinct combination of the two colunms, wich is not what I want. For instance:
Every row above is distinct, but I want only rows that are distinct in the first column:
Is that possible, if so how?