"John Lister" <john.lister...@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 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql