If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > limiting row return by count

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 17:34
mznvz8 mznvz8 is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Question limiting row return by count

Does Informix have a function similar to Oracle's "rownum" command to limit the number of rows returned on a query?

Oracle example: select * from test_tbl where rownum < 10;
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 22:04
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: limiting row return by count

Quote:
Originally posted by mznvz8
Does Informix have a function similar to Oracle's "rownum" command to limit the number of rows returned on a query?

Oracle example: select * from test_tbl where rownum < 10;
Hi there,

you can use "rowid" in informix.

Regards,

lloyd
Reply With Quote
  #3 (permalink)  
Old 01-16-04, 03:55
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

You may also use FIRST keyword to to limit the number of rows returned in a query.

example:
select first 5 * from test_tbl ;

Regards,
Shriyan
Reply With Quote
  #4 (permalink)  
Old 01-16-04, 06:13
Nicjordan Nicjordan is offline
Registered User
 
Join Date: Jan 2004
Location: Somerset
Posts: 5
Quote:
Originally posted by vpshriyan
Hi,

You may also use FIRST keyword to to limit the number of rows returned in a query.

example:
select first 5 * from test_tbl ;

Regards,
Shriyan
My 2c

This first 5 method is much better - on one of my tables the rowid starts at 259 - so 'where rowid < 6' does not return anything, but 'first 5' gives 5 returns.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On