On 4/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How about these: > > SELECT * from Mactor WHERE id = (SELECT MAX(id) FROM Mactor); > SELECT * from Mactor WHERE id = (SELECT MIN(id) FROM Mactor);
I am working on a similar problem at the moment, but unless I missed something, ORDER BY id LIMIT 1 works fine for me. Is there any benefit of one formulation against the other? Is the nested SELECT less efficient? Or are they identical in bytecode? What if id is not unique, and I may have rows with identical id? And can this be generalised for other databases? Yours, Thomas