[thelist] A Little Query Question

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Fri Dec 2 16:55:20 CST 2005


	I don't think the START keyword exists in TSQL (at least not
pre-2005).

	How about this:  you're ordering the results in some fashion,
right?  What if you grab that sort field (or fields) on the last record
and pass it back with your request for the next page?  Then you could
say "select top 20 where mysortfield > thisvalue".

	Of course that could fail for a variety of reasons, e.g. you
change the sort order or there are duplicate values in the fields where
you're trying to sort...  Admittedly, I'm not a database guru.

FWIW...

Peter

-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Casey

Okay - I think my question was not too clear.  I'm doing a paging thing 
where each page only shows 15 results.  Then the user can select to see
the 
next 15, then the next, etc.

So, on the initial page load, we can just select the top 15.  No prob. 
Then, if the user wants to see page 2, we need to select items 16 - 30.

I found this with google:   TOP n [ START AT m ]

but I'm not getting it to work.  Hope all this makes sense.  Thanks!

Casey

----- Original Message ----- 
From: "Casey" <aspnet at thecrookstons.com>

> If you wanted to return the top 15 rows from a table, you could say
> "SELECT
> TOP 15 FROM table WHERE..."
>
> How would you word the query if you wanted rows 16 to 30?
>
> (asp.net with MS SQL)
>
> Thanks Tim!!!
>
> Casey
>
> --
>
> * * Please support the community that supports you.  * * 
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester and 
> archives of thelist go to: http://lists.evolt.org Workers of the Web, 
> evolt !

-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 






More information about the thelist mailing list