Re: howto/min values

From: "Sjors" <jkwast(at)freeler(dot)nl>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: howto/min values
Date: 2003-03-19 15:07:45
Message-ID: 002b01c2ee29$4c57d690$04a779d9@cc299057a
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> >
> No, not at all. Something like
>
> select p.points, p.id, p.distance from
> (select points, id, (x-x) as distance from table) as p
> where p.distance = (select min(p1.distance)
> > from table as p1
> > where p.points=p1.points)
> > order by p.points, p.id ;
>
> should do the trick.
> The FROM clause allows any kind of subqueries within parentheses.
>
> Regards, Christoph
>
Thanks, this is the solution.

greetz Sjors

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message cliff 2003-03-19 16:18:36 integrity of column used to order rows
Previous Message Victor Yegorov 2003-03-19 15:02:42 Re: vacuum all but system tables