I have a table that looks like this:
id | group | title | description | added | modified
---------------------------------------------------
1 | 1 | ... | ... | ... | ...
2 | 1 | ... | ... | ... | ...
3 | 2 | ... | ... | ... | ...
4 | 2 | ... | ... | ... | ...
5 | 3 | ... | ... | ... | ...
Now I need to select the first row of every group value. I think using the DISTINCT keyword is kind of the right direction here. But using:
SELECT DISTINCT group FROM table;
obviously would return only the group values, but not the remaining fields:
group
-----
1
2
3
Does anyone know how to accomplish this?
What I'm looking for is - in regard to the above example - this kind of output:
id | group | title | description | added | modified
---------------------------------------------------
1 | 1 | ... | ... | ... | ...
3 | 2 | ... | ... | ... | ...
5 | 3 | ... | ... | ... | ...
Thanks in advance!!
zgroup(to be pronounced with a German accent ;-)