Re: an aggregate to return max() - 1 value? - Mailing list pgsql-sql

From Gerardo Herzig
Subject Re: an aggregate to return max() - 1 value?
Date
Msg-id 4B901488.6080502@fmed.uba.ar
Whole thread Raw
In response to an aggregate to return max() - 1 value?  (Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>)
Responses Re: an aggregate to return max() - 1 value?
List 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


pgsql-sql by date:

Previous
From: Rob Sargent
Date:
Subject: Re: an aggregate to return max() - 1 value?
Next
From: Greg Stark
Date:
Subject: Re: an aggregate to return max() - 1 value?