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 > DB2 > SQL request that retreive a limited number of row

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-04, 11:29
Dave Rush Dave Rush is offline
Registered User
 
Join Date: Jun 2004
Posts: 15
SQL request that retreive a limited number of row

Hi,

I would like to retrive with an SQL select statement a limited number of row.

On ADABAS:the request would be:

db2 "select * from tablename where rowno<=5"

This retreive 5 first row.

SQL0206N "ROWNO" is not valid in the context where it is used.
SQLSTATE=42703

Thanks
Reply With Quote
  #2 (permalink)  
Old 07-08-04, 11:32
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
use "fetch first <no_of_rows> rows only". after from clause.

regards,

mujeeb
Reply With Quote
  #3 (permalink)  
Old 07-08-04, 11:44
Dave Rush Dave Rush is offline
Registered User
 
Join Date: Jun 2004
Posts: 15
thanks a lot this is working
Reply With Quote
  #4 (permalink)  
Old 07-08-04, 12:12
Dave Rush Dave Rush is offline
Registered User
 
Join Date: Jun 2004
Posts: 15
thanks a lot this is working
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