Controlling Reuslts with Limit
Najm Hashmi <najm@mondo-live.com>
From: Najm Hashmi <najm@mondo-live.com>
To: pgsql <pgsql-sql@postgresql.org>
Date: 2001-02-24T21:09:06Z
Lists: pgsql-sql
Attachments
- najm.vcf (text/x-vcard)
Hi,
I was reading through Bruce's on line . I found follwing bit unclear...
"Notice that each query uses ORDER BY . Although this clause is not required,
LIMIT without ORDER BY returns random rows from the query, which would be
useless. "
When I run a query several time I get the same results as given
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
(5 rows)
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
(5 rows)
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
(5 rows)
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
(5 rows)
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
(5 rows)
flipr=# select song_id from songs limit 5;
song_id
---------
945
946
947
948
949
I just want to know what exatly --"LIMIT without ORDER BY returns random rows
from the query" --means
Regards