Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 subset (range) of select result

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-16 : 08:13:06
Howard Chu writes "Hi there,

I'm writing the search engine... the select result returns n records. However, I just want each subset of the result at the time. How can I slice and just get a piece of the result with lower range and upper range

For example:
Result returns 500 rows.
I want the page display 20 rows at a time.
First, I just want to have the first 20 rows (1-20).
Then if user click Next, I run the query again and want to have the next 20 rows (21-40)

I can do slice in my script... but it's costly to transfer all the time 500 rows while I need only 20 rows

In Oracle, I used 'row_number' and 'between'.... Is there any equivalent in SQL


Thanks,
-Howard"
   

- Advertisement -