EXTERN JOIN with WHEN query - Mailing list pgsql-general

From javier garcia - CEBAS
Subject EXTERN JOIN with WHEN query
Date
Msg-id 200306051443.h55EhnI04037@natura.cebas.csic.es
Whole thread Raw
Responses Re: EXTERN JOIN with WHEN query  (Bruno Wolff III <bruno@wolff.to>)
Re: EXTERN JOIN with WHEN query  (Richard Huxton <dev@archonet.com>)
Re: EXTERN JOIN with WHEN query  (Manfred Koizar <mkoi-pg@aon.at>)
Re: EXTERN JOIN with WHEN query  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
Hi all;
This is a query that I guess is not very difficult, but I'm a newbie;
I've got a lot of tables, each of them with two columns:

SELECT * FROM precal; ->
  (date)     (real)
   fecha    | precipitacion
------------+---------------
 1996-01-01 |             0.6
 1996-02-01 |             0.7
...


But in this table there are some inexistents records (some missing days)
And I would like to create lists with a full list of dates and corresponding
precipitation data, with gaps when the row didn't exist.
So; I've created a table with a complete series of dates from 1950 up to
date, and made the query:

 SELECT fechas.fecha,precipitacion FROM fechas LEFT OUTER JOIN precal41 ON
(fechas.fecha  = precal41.fecha);

This is perfect. But to make it better,  would like to include just the dates
from the first one in the precal table. So, I've tried:

SELECT fechas.fecha,precipitacion FROM fechas LEFT OUTER JOIN precal41 ON
(fechas.fecha  = precal41.fecha) WHEN fechas.fecha >= min(precal41.fecha);

With the answer:

ERROR:  parser: parse error at or near "WHEN"

Could you help me with this query?

Thanks and regards

Javier

-------------------------------------------------------

pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Is jdbc.postgresql.org down?
Next
From: Joel Rodrigues
Date:
Subject: Re: regular expression question