RE: Limiting number of rows in a select...
Posted in 1997
Mickey
Heres a query that I use to get the first 10 rows from a table:
SELECT * FROM tablename a
WHERE 10 >
(SELECT COUNT(*) FROM tablename b
WHERE a.rowid > b.rowid)
ORDER BY 1;
HTH
Sujit Pal
----------
From: Mickey Mestel[SMTP:mickm@netcom.com]
Sent: Tuesday, August 12, 1997 6:53 PM
To: informix-list@rmy.emory.edu
Subject: Q: Limiting number of rows in a select...
hi,
i know this has been posted before, but i can't find it. what is
a good way to limit the number of rows returned by a select, like if you
only want the first 10 or something?
thanks,
mickm
--
_____________________________________________________________________________
Mickey Mestel mickm@netcom.com
-on a beach in thailand to a beautiful, stoned, norwegian woman:
"..yeah, it's just another foreign country without ice."
-----------------------------------------------------------------------------