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 > Pervasive.SQL > Taking specific number of rows from the database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-07, 07:32
1qaz2wsx7 1qaz2wsx7 is offline
Registered User
 
Join Date: Jul 2007
Posts: 13
Taking specific number of rows from the database

Hi

I have a pervasive.sql database, and i want to select, using the sql command
only a seeral rows, lets say i want to take the 25# - 30# rows, how can i do that ?

What i found is the command TOP but its not good because its always starts
from the beginning, and i want to take lets say from the middle, from the x row to the y row.

Can i do that ?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 09-05-07, 13:06
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
You might be able to take the top 30 rows within a subquery, sort the results in DESC order, then select the top 5 from the subquery & finally sort THAT in descending order again... (to get the results you need)
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On