Re: select only the first record - Mailing list pgsql-sql

From Christof Glaser
Subject Re: select only the first record
Date
Msg-id 01071015385500.00730@pinguin
Whole thread Raw
In response to select only the first record  (juerg.rietmann@pup.ch)
List pgsql-sql
On Tuesday, 10. July 2001 15:09, 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

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




pgsql-sql by date:

Previous
From: Jan Wieck
Date:
Subject: Re: select only the first record
Next
From: "Josh Berkus"
Date:
Subject: Problems with PG_DUMP and restore