pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: an aggregate to return max() - 1 value?
Date: Thu, 04 Mar 2010 13:20:23 -0700
Message-ID: <4B901607.2090409@gmail.com> (raw)
In-Reply-To: <20100304200913.GA24865@apartia.fr>
References: <20100304200913.GA24865@apartia.fr>

'select max(col) where col < max(col)' should work but you have to do 
'where col < (select max(col) '

On 03/04/2010 01:09 PM, Louis-David Mitterrand wrote:
> Hi,
>
> With builtin aggregates is it possible to return the value just before
> max(col)?
>
> Thanks,
>



view thread (6+ messages)  latest in thread

Message-ID: <4B901607.2090409@gmail.com>
Permalink:  ../4B901607.2090409@gmail.com/
Also on:    postgresql.org/message-id/4B901607.2090409@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: an aggregate to return max() - 1 value?
  In-Reply-To: <4B901607.2090409@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox