Re: select only the first record

From: Christof Glaser <gcg(at)gl(dot)aser(dot)de>
To: juerg(dot)rietmann(at)pup(dot)ch, pgsql-sql(at)postgresql(dot)org
Subject: Re: select only the first record
Date: 2001-07-10 13:38:55
Message-ID: 01071015385500.00730@pinguin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, 10. July 2001 15:09, juerg(dot)rietmann(at)pup(dot)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

SELECT * FROM cars ORDER BY <your pkey> LIMIT 1;

Without ORDER BY, there is no "first" record - any record could be
returned.

Regards,
Christof Glaser

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-07-10 14:50:24 Problems with PG_DUMP and restore
Previous Message Jan Wieck 2001-07-10 13:31:46 Re: select only the first record