Re: SQL subqueries newbie help - Mailing list pgsql-sql

From Tom Lane
Subject Re: SQL subqueries newbie help
Date
Msg-id 25820.1062944553@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL subqueries newbie help  (Rod Taylor <rbt@rbt.ca>)
List pgsql-sql
Rod Taylor <rbt@rbt.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


pgsql-sql by date:

Previous
From: Alexei Chetroi
Date:
Subject: Re: SQL subqueries newbie help
Next
From: "Marek Lewczuk"
Date:
Subject: plPGSQL bug in function creation