Re: Can this be done in one query?

From: Randall Perry <rgp(at)systame(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can this be done in one query?
Date: 2002-05-12 03:21:14
Message-ID: B90357EA.149A1%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> On Tue, 7 May 2002, Randall Perry wrote:
>
>> With the following:
>>
>> select max(date) from log order by date_time desc limit 12;
>>
>> The limit clause has no effect on the results; it'll get the latest date
>> from the entire record set rather than from the last 12 records.
>
> Maybe something like:
> select max(date) from (select date from log order by date_time desc limit
> 12) c;

Thanks, that did it.

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Randy Perry
sysTame
Mac Consulting/Sales

phn 772.589.6449
mobile email help(at)systame(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alan Wayne 2002-05-12 05:56:00 Use of OIDS as primary keys
Previous Message Dorward Villaruz 2002-05-12 01:41:14 postges error?