Jochen Wiedmann wrote on 28.07.2005:
On 7/28/05, Jan Eden <lis...@janeden.org> wrote:
this must be quite simple, but I have no clue how to do it: Can I select the
row where a certain column has the highest table of all rows satisfying another
where condition?
position = MAX(position)
might do the trick. Dunno, which version of MySQL supports it, but the
latest should do.
I feared that it would be that simple. Doh!
BTW, the manual says you need a subselect as of MySQL 4.1
SELECT id FROM table WHERE position = (SELECT MAX(position) FROM table);
In older version, you first need to do a select for the MAX value, then a second
one for the row.
Thanks,
Jan