Re: How to limit # of rows returned by SELECT

From: Trevor Best <trevor_at_microprism.com>
Date: 1996/02/10
Message-ID: <4fibev$o8m_at_lemon.easynet.co.uk>#1/1


On Thu, 08 Feb 1996 15:04:40 -0500 in comp.databases.ms-access, Badri Gandavadi <badrig_at_hargray.com> wrote:

>Try ROWNUM.
>But, if you have ORDER BY clause you cannot count on this always.

Sorry, I've missed the oroginal post, so forgive me if I'm off track. in Access you can use a Top Values query, e.g.

SELECT TOP <n> <fieldlist> FROM <table> WHERE <cond.> ORDER BY <orderlist>;

The key is in the order by statement as to which <n> are selected. (not sure if 'pair of ducks' supports this).

                    \|||/
                    /   \
                   C o o D
-----------------ooO--u--Ooo-------------------------------
Have you set BUGS=NO in Config.sys?

trevor_at_microprism.com - Microprism (UK) Limited Received on Sat Feb 10 1996 - 00:00:00 CET

Original text of this message