pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: an aggregate to return max() - 1 value?
Date: Fri, 5 Mar 2010 07:33:01 +0100
Message-ID: <162867791003042233u5175ecd4u448cd1ae198e08ce@mail.gmail.com> (raw)
In-Reply-To: <20100304200913.GA24865@apartia.fr>
References: <20100304200913.GA24865@apartia.fr>

Hello

select min(x) from (select x from data order by x desc limit 2) s;

Pavel

2010/3/4 Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>:
> Hi,
>
> With builtin aggregates is it possible to return the value just before
> max(col)?
>
> Thanks,
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>



view thread (6+ messages)  latest in thread

Message-ID: <162867791003042233u5175ecd4u448cd1ae198e08ce@mail.gmail.com>
Permalink:  ../162867791003042233u5175ecd4u448cd1ae198e08ce@mail.gmail.com/
Also on:    postgresql.org/message-id/162867791003042233u5175ecd4u448cd1ae198e08ce@mail.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: pavel.stehule@gmail.com
  Subject: Re: an aggregate to return max() - 1 value?
  In-Reply-To: <162867791003042233u5175ecd4u448cd1ae198e08ce@mail.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