From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rod Taylor <rbt@rbt.ca>
Cc: Alexei Chetroi <lexoid@lexa.uniflux-line.net>
Cc: Pgsql-Sql <pgsql-sql@postgresql.org>
Subject: Re: SQL subqueries newbie help
Date: Sun, 07 Sep 2003 10:22:33 -0400
Message-ID: <25820.1062944553@sss.pgh.pa.us> (raw)
In-Reply-To: <1062940175.54737.22.camel@jester>
References: <20030906110709.GA13384@uniflux-line.net>
<1062868895.54737.3.camel@jester>
<20030907114226.GA22231@uniflux-line.net>
<1062940175.54737.22.camel@jester>
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
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: tgl@sss.pgh.pa.us, rbt@rbt.ca, lexoid@lexa.uniflux-line.net
Subject: Re: SQL subqueries newbie help
In-Reply-To: <25820.1062944553@sss.pgh.pa.us>
* 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