Re: EXTERN JOIN with WHEN query
От | Richard Huxton |
---|---|
Тема | Re: EXTERN JOIN with WHEN query |
Дата | |
Msg-id | 200306061128.46252.dev@archonet.com обсуждение исходный текст |
Ответ на | EXTERN JOIN with WHEN query (javier garcia - CEBAS <rn001@cebas.csic.es>) |
Список | pgsql-general |
On Thursday 05 Jun 2003 3:56 pm, javier garcia - CEBAS wrote: > 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); Perhaps something like (not tested): SELECT .... WHERE fechas.fecha >= (SELECT min(precal41.fecha) FROM precal41); -- Richard Huxton
В списке pgsql-general по дате отправления: