Re: an aggregate to return max() - 1 value?

From: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: an aggregate to return max() - 1 value?
Date: 2010-03-04 20:14:00
Message-ID: 4B901488.6080502@fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Louis-David Mitterrand wrote:
> Hi,
>
> With builtin aggregates is it possible to return the value just before
> max(col)?
>
> Thanks,
>
Mmmm what about
select max(col) from table where col not in (select max(col) from table;
? Looks like a double table reading, but it works.

Gerardo

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Sargent 2010-03-04 20:20:23 Re: an aggregate to return max() - 1 value?
Previous Message Louis-David Mitterrand 2010-03-04 20:09:14 an aggregate to return max() - 1 value?