RE: First N records in SELECT
Posted in 1997
Slavic
Not directly no. But you can do this using a correlated subquery. It isn't very efficient though:
SELECT *
FROM tablename a
where N >
(SELECT COUNT(*) FROM tablename b
WHERE a.rowid < b.rowid)
where tablename is the table you need and N is the first N records
you need to select.
In XPS I believe this feature is supported directly.
HTH
Sujit Pal
----------
From: Slavik Anosov[SMTP:parker@topaz.kiev.ua]
Sent: Friday, July 25, 1997 6:30 AM
To: informix-list@rmy.emory.edu
Subject: First N records in SELECT
Does anybody know something in Informix ODS 7.1 that perform functions of
Oracle's ROWNUM pseudo-column? I need to retrieve only first N records in
select.
Slavik
Slavik Anosov
-----------------------------------------------------------------
phone (W): +(380-44) 242-3674, fax: +(380-44) 444-3157
e-mail: parker@topaz.kiev.ua, agrotep@public.ua.net