hi all
i have a table in my data base that have the following schema:
mytable ( id , value)
like this:
id value
1 4
2 7
3 10
4 1
5 20
need to fetch 'id' of the row that have the max value in 'value' i try this query (and worked) :
SELECT R.id
FROM (SELECT id , MAX(value)
FROM mytable
GROUP BY id) as R(id,mymax)
my question : is there any better way to doing this work ? if so,how?
Bookmarks