Re: Best method to SELECT TOP n TO m of a table

From: Will Clark <reply_only_to_newsgroup_please_at_noone-lives-here.com>
Date: Wed, 5 Nov 2003 12:10:09 +0000 (UTC)
Message-ID: <boapb1$1jq$1_at_hercules.btinternet.com>


> I don't recognize this "TOP n" stuff (proprietary to some specific
> system, I guess?),

Yes, sorry, its a Microsoft SQL Server keyword

> but the way I'd do it is:
>
> SELECT *
> FROM table AS t
> WHERE (SELECT id FROM table WHERE id < t.id) BETWEEN 5 AND 7;

Thanks for the suggestion - I'm trying out a couple of different approaches that you and a couple of other people have given me... hopefully I'll be able to pin down the fastest way of doing it.

Thanks for your help :o) Received on Wed Nov 05 2003 - 13:10:09 CET

Original text of this message