Re: obtaining difference between minimum value and next in size - Mailing list pgsql-sql

From Tom Lane
Subject Re: obtaining difference between minimum value and next in size
Date
Msg-id 27014.1290008556@sss.pgh.pa.us
Whole thread Raw
In response to obtaining difference between minimum value and next in size  ("John Lister" <john.lister-ps@kickstone.com>)
List pgsql-sql
"John Lister" <john.lister-ps@kickstone.com> writes:
> Is it possible to obtain the difference between just the minimum price and the next one up per product,

If you're using >= 8.4, try a window function.  LEAD or LAG ought to
do it.
        regards, tom lane


pgsql-sql by date:

Previous
From: "John Lister"
Date:
Subject: obtaining difference between minimum value and next in size
Next
From: Andreas Kretschmer
Date:
Subject: Re: obtaining difference between minimum value and next in size