pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sjors <jkwast@freeler.nl>
To: pgsql-sql@postgresql.org
Subject: Re: howto/min values
Date: Wed, 19 Mar 2003 16:07:45 +0100
Message-ID: <002b01c2ee29$4c57d690$04a779d9@cc299057a> (raw)
References: <3E78767B.47CA0F73@rodos.fzk.de>

> >
> 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
 
 



view thread (3+ messages)

Message-ID: <002b01c2ee29$4c57d690$04a779d9@cc299057a>
Permalink:  ../002b01c2ee29$4c57d690$04a779d9@cc299057a/
Also on:    postgresql.org/message-id/002b01c2ee29$4c57d690$04a779d9@cc299057a

 · 

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: jkwast@freeler.nl
  Subject: Re: howto/min values
  In-Reply-To: <002b01c2ee29$4c57d690$04a779d9@cc299057a>

* 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