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

From: Tom Ivar Helbekkmo <tih+nr_at_eunetnorge.no>
Date: Wed, 05 Nov 2003 13:54:33 +0100
Message-ID: <86llqvc6wm.fsf_at_athene.i.eunet.no>


"Will Clark" <reply_only_to_newsgroup_please_at_noone-lives-here.com> writes:

>> SELECT *
>> FROM table AS t
>> WHERE (SELECT id FROM table WHERE id < t.id) BETWEEN 5 AND 7;
>
> Thanks for the suggestion - [...]

Oops! Before you try it, note that I mistyped: "SELECT id" should, of course, be "SELECT COUNT(*)" to work. :-)

That should teach me to actually test even the obviously simple stuff.

-tih

-- 
Tom Ivar Helbekkmo, Senior System Administrator, EUnet Norway
www.eunet.no  T: +47-22092958 M: +47-93013940 F: +47-22092901
Received on Wed Nov 05 2003 - 13:54:33 CET

Original text of this message