I have a table which looks like this:
NAME Col1 Col2 Col3
Tim 1 2 3
Tim 1 1 2
Tim 2 1 2
Dan 1 2 3
Dan 2 2 1
Dan 2 1 3
Im trying to make a SELECT command which results in this:
NAME Col1 Col2 Col3
Tim 2 1 2
Dan 2 2 1
So I want distinct Names but select all four columns and where Col1 = 2. I used the solution here to get the distinct part working: SQL/mysql - Select distinct/UNIQUE but return all columns?
But when I add add Col1 = '2'
to the WHERE part of the select statement is does not return all names where Col1 is 2 because i think it looks at a different one first which is not 1 so takes that result.
Hope I made sense and someone can help. Was hard to explain and come up with a good title. Thanks!