John,
Great to hear it helped you out
Best,
Oliver
- Original Message -
From: John Lister
To: pgsql-sql@postgresql.org
Sent: Wednesday, November 17, 2010 10:46 PM
Subject: Re: [SQL] obtaining difference between minimum value and next in size
Cheers oliverios and tom for
groups.
John
- Original Message -
From: Oliveiros d'Azevedo Cristina
To: John Lister ; pgsql-sql@postgresql.org
Sent: Wednesday, November 17, 2010 4:09 PM
Subject: Re: [SQL] obtaining difference between minimum value and next in size
Hi, John.
I am not familiar wit
ster
To: pgsql-sql@postgresql.org
Sent: Wednesday, November 17, 2010 3:11 PM
Subject: [SQL] obtaining difference between minimum value and next in size
Hi, I was wondering if it is possible to do this with a single query rather
than iterate over all of the rows in an application:
I h
John Lister wrote:
> Hi, I was wondering if it is possible to do this with a single query rather
> than iterate over all of the rows in an application:
>
> I have a table which for brevity looks like:
> create table offers {
> integer id;
> integer product_id;
> double price;
> }
>
> wh
"John Lister" 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
--
Sent via pgsql-sql mailing list (pgsql-sql
Hi, I was wondering if it is possible to do this with a single query rather
than iterate over all of the rows in an application:
I have a table which for brevity looks like:
create table offers {
integer id;
integer product_id;
double price;
}
where for each product there is a number of of