Re: newbie question for return date

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
Cc: missive(at)hotmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: newbie question for return date
Date: 2002-10-29 18:24:44
Message-ID: 22753.1035915884@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com> writes:
> Hey a suggestion, what if PG would support the negative limit as in
> select * from table limit -1 to mean limit it from the other end of
> list.....

You'd hardly want that, as it would necessarily be the slowest possible
way of retrieving the rows you're after.

Instead, reverse the sort order. For example

select * from table order by datecol desc limit 1;

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Medi Montaseri 2002-10-29 18:44:34 Re: DAFS?
Previous Message Neil Conway 2002-10-29 18:24:40 Re: EXPLAIN times