On Fri, 2003-07-25 at 04:53, A.Bhuvaneswaran wrote:
> > 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;
Since oid is way non-standard, a better way may be:
=> select your_fields from your_table where your_condition order by
your_fields desc limit 1;
--
+-----------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@cox.net |
| Jefferson, LA USA |
| |
| "I'm not a vegetarian because I love animals, I'm a vegetarian |
| because I hate vegetables!" |
| unknown |
+-----------------------------------------------------------------+