I have this table:
-------
id a b
-------
1 1 1
2 1 5
3 1 1
4 1 1
5 1 6
How do I select this?
-------
id a b
-------
1 1 1
2 1 5
5 1 6
I have this table:
-------
id a b
-------
1 1 1
2 1 5
3 1 1
4 1 1
5 1 6
How do I select this?
-------
id a b
-------
1 1 1
2 1 5
5 1 6
THe below would get you what you want in your example but i am not sure if the min ID is useful if it is the key.
SELECT MIN(id), a, b
FROM table
GROUP BY a,b