pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Long <justinlong@strategicnetwork.org>
To: pgsql-sql@hub.org
Subject: SELECT TOP _x_ ??
Date: Thu, 22 Apr 1999 10:33:02 -0400
Message-ID: <000401be8ccd$06c7e320$0a411a9f@cbn.org> (raw)

In Microsoft SQL Server you could issue a command

	SELECT TOP 5 * FROM database...


The top 5 indicator would mean to take the top 5 records that matched the
criteria. I can't seem to find any way to do this in PostgreSQL. I have a
database of 385 records (which will grow rapidly over the next few months)
and it takes better than 5 seconds to SELECT from the 385 and then use a
while loop to display the top 4. I can't imagine what it will be like when
we reach, say, 10,000 records! So any suggestions for selecting just the top
5 and speeding the process up a bit?

Any responses will be greatly appreciated. Respond here or to
JustinLong@strategicnetwork.org ...


Never retreat. Never surrender. Never cut a deal with a dragon.
_______________________________________________________________
Justin Long                   CIO / Site Editor
616 Station Square Ct         Network for Strategic Missions
Chesapeake, VA 23320          977 Centerville Trnpk CSB 317
JustinLong@xc.org             Va Beach, VA 23463
Check out our site at:        http://www.strategicnetwork.org




view thread (5+ messages)  latest in thread

Message-ID: <000401be8ccd$06c7e320$0a411a9f@cbn.org>
Permalink:  ../000401be8ccd$06c7e320$0a411a9f@cbn.org/
Also on:    postgresql.org/message-id/000401be8ccd$06c7e320$0a411a9f@cbn.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: justinlong@strategicnetwork.org, pgsql-sql@hub.org
  Subject: Re: SELECT TOP _x_ ??
  In-Reply-To: <000401be8ccd$06c7e320$0a411a9f@cbn.org>
  References: <000401be8ccd$06c7e320$0a411a9f@cbn.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox