pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: juerg.rietmann@pup.ch
Cc: pgsql-sql@postgresql.org
Subject: Re: select only the first record
Date: Tue, 10 Jul 2001 09:31:46 -0400 (EDT)
Message-ID: <200107101331.f6ADVk914719@jupiter.us.greatbridge.com> (raw)
In-Reply-To: <OF69D0BD4E.6176557A-ONC1256A85.0048269D@pup.ch>

juerg.rietmann@pup.ch wrote:
> Hello there
>
> Is it possible to do a query and selecting only the first record in ad
> table ?
>
> e.g. select FIRST * from cars

    You  can either use a CURSOR and FETCH only the first row, or
    use LIMIT (non-standard).

    And you might  want  to  explicitly  ORDER  the  result  set,
    otherwise   exchange   "FIRST"   with  "ONE-RANDOM"  in  your
    question.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




view thread (3+ messages)  latest in thread

Message-ID: <200107101331.f6ADVk914719@jupiter.us.greatbridge.com>
Permalink:  ../200107101331.f6ADVk914719@jupiter.us.greatbridge.com/
Also on:    postgresql.org/message-id/200107101331.f6ADVk914719@jupiter.us.greatbridge.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: JanWieck@Yahoo.com, juerg.rietmann@pup.ch
  Subject: Re: select only the first record
  In-Reply-To: <200107101331.f6ADVk914719@jupiter.us.greatbridge.com>

* 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