Em Tue, 07 Nov 2006 17:03:17 -0800, Stuart Bishop escreveu:

> 
> The following SQL statement will return the last 200 rows in reverse order:
> 
> SELECT * FROM seconds ORDER BY tempounix DESC LIMIT 200
> 
> This will only send 200 rows from the server to the client (your existing
> approach will send all of the rows). Also, if you have an index on tempounix
> it will be really fast.
> 
> 
> If you really need the results in tempounix order, then:
> 
> SELECT * FROM (
>     SELECT * FROM seconds ORDER BY tempounix DESC LIMIT 200
>     ) AS whatever
> ORDER BY tempounix;

Thank you Stuart, I'll try it.

Luis P. Mendes
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to