I have a table as follows:
id | division
1 | 1
2 | 1
3 | 17
4 | 17
.... | ....
How would I select the maximum id associated with a unique division number? For instance, here I want to select 2 and 4 as these are the highest numbers associated with 1 and 17. I do not want to select 1 and 3.
Can this be done with SQL alone or do I need to program a solution?