Liz Steel wrote:
I'm doing a select on a table as follows, and I want to get the last item in the list. How can I do this without having to step through all of the previous items? This may or may not return 100 rows since I cannot be sure of the size of the data.

select * from tablename where timestamp < '2003/12/04 12:00:00:000' order by timestamp limit 100;

select * from tablename where timestamp < '2003/12/04 12:00:00:000' order by timestamp desc limit 1;

HTH,

-- Gerhard


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to