Mysql Select distinct value from one column when selecting from two columns

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:
a 1
a 2
a 5
b 1
c 3

Every row above is distinct, but I want only rows that are distinct in the first column:
a 1
b 1
c 3

Is that possible, if so how?
LVL 2
itniflAsked:
Who is Participating?
 
fundacionrtsConnect With a Mentor Administrador de SistemasCommented:
If you always want the row that have second-column value lower, you can try

SELECT column1,MIN(column2) FROM table GROUP BY column1
0
 
itniflAuthor Commented:
I want to select dinstinctly based on the left column and not the right.
0
 
itniflAuthor Commented:
You were right, in my case it was:
SELECT MIN(column1),column2 FROM table GROUP BY column1
0
All Courses

From novice to tech pro — start learning today.