Re: Get the last record alone from the select statement.

From: "A(dot)Bhuvaneswaran" <bhuvan(at)symonds(dot)net>
To: HK <harikrishnan(at)midascomm(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Get the last record alone from the select statement.
Date: 2003-07-25 09:53:34
Message-ID: Pine.LNX.4.44.0307251521500.2337-100000@Bhuvan.bksys.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> Hi all,
> I have a doubt in limit clause. With limit and offset i can get the
> first few records from the select statement. Suppose i want to get the
> last record alone from the select, how can i achieve it.

=> select your_fields from your_table where your_condition order by
oid desc limit 1;

regards,
bhuvaneswaran

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message papapep 2003-07-25 10:38:41 Re: Questions about Exists-Not exists clause
Previous Message Dag Gullberg 2003-07-25 09:06:00 Re: question about images