Skip to Content.
Sympa Menu

freetds - Re: Implementation of select Limit

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Implementation of select Limit
  • Date: Fri, 9 Nov 2001 12:42:56 -0500


Well typically the you start at the top at some point, so you can say

select top 100 * from table where keycol > 'last value of key column from
previous page'

of course that blows up if you sort it on a non unique column.

Brian

> --IiVenqGWf+H9Y6IX
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> On Fri, Nov 09, 2001 at 07:32:06AM -0500, Brian Bruns wrote:
> >=20
> > Doesn't SQL Server have a limit-type statement? Sybase doesn't but I'm=20
> > pretty sure MS added one....back, back, back into the recesses of my mind=
> ,=20
> > I think its like:
>
> > select top 100 * from table
>
> You can select records from the top, yes -- I've always been annoyed at
> this deficiency of MS SQL, because usually when I want to limit the
> results returned, it's because I'm running the query from a web script
> that returns x number of results /at a time/... which means after you
> get the /first/ 100 records, logically you might want to look at the
> /second/ set of 100 records, and MS SQL doesn't provide a sensible
> interface to this that I've seen.
>
> Steve Langasek
> postmodern programmer
>
> --IiVenqGWf+H9Y6IX
> Content-Type: application/pgp-signature
> Content-Disposition: inline
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE76/OGKN6ufymYLloRAuWRAJ4qzVIG9ETIvd++bQ7Z2pR4tvtWTwCfYk5T
> ncmAcjIZU8q/Hmd4XFCdviY=
> =KDLH
> -----END PGP SIGNATURE-----
>
> --IiVenqGWf+H9Y6IX--




Archive powered by MHonArc 2.6.24.

Top of Page