I have the following simple SQL statment
SELECT id, name, value_name, value_id
FROM table
GROUP BY id
ORDER BY value_id DESC
when grouping I would like to get the value_name and value_id of the tuple where the value_id is the biggest. The way it is i am getting the smallest value. For example
1, name1, valuename, 3 (where i know that there is a value_id of 5)
Can you please help?