Re: Can this be done in one query?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Randall Perry <rgp(at)systame(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can this be done in one query?
Date: 2002-05-07 22:48:01
Message-ID: 20020507154610.R79337-100000@megazone23.bigpanda.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;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Lane 2002-05-07 23:15:48 Re: Subject: bool / vacuum full bug followup part 2
Previous Message Samuel J. Sutjiono 2002-05-07 22:40:32 Performance issues with compaq server