Re: SQL subqueries newbie help

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Alexei Chetroi <lexoid(at)lexa(dot)uniflux-line(dot)net>, Pgsql-Sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL subqueries newbie help
Date: 2003-09-07 14:22:33
Message-ID: 25820.1062944553@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rod Taylor <rbt(at)rbt(dot)ca> writes:
> Oh yeah, sorry. It needs to be like that because otherwise it is unsure
> what value to use for event. What you really want is a min function
> that runs a min on date, and returns the appropriate event -- which
> doesn't exist, but I believe could be created

SELECT DISTINCT ON might provide a simpler solution to that requirement.
Check out the "weather reports" example in the SELECT reference page.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kris Jurka 2003-09-08 08:21:44 Re: MINUS & ROWNUM in PostGres
Previous Message Alexei Chetroi 2003-09-07 14:19:50 Re: SQL subqueries newbie help