Re: Can this be done in one query?

From: Randall Perry <rgp(at)systame(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Subject: Re: Can this be done in one query?
Date: 2002-05-08 16:03:48
Message-ID: 20020508164443.VVTO8262.imf18bis.bellsouth.net@[216.77.205.74]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks, that's the best solution.

But I don't get the syntax; what's the 'c' at the end -- an alias?

>
> 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;
>
>
> ---------------------------(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 Tom Lane 2002-05-08 16:53:19 Re: Fast statement but slow function
Previous Message Scott Marlowe 2002-05-08 15:13:35 Re: Allow user to create tables