for example I have this table:
itemgroup | description | price
A, a, 10
A, b, 12
A, c, 14
B, g, 11
B, h, 16
I want to select the rows with the highest price in one group like this:
A, c, 14
B, h, 16
The SQL query (is fully functional) which gets me near this is:
SELECT itemgroup, MAX( price )
FROM table
GROUP BY itemgroup
A, 14
B, 16
By trying this I get an "not a GROUP BY expression"-error:
SELECT itemgroup, description, MAX( price )
FROM table
GROUP BY itemgroup
I need something like this pseudo query:
SELECT itemgroup, IGNORE( description), MAX( price )
FROM table
GROUP BY itemgroup
I hope I could explain my little problem.
I normally end up doing something like: