Re: [GENERAL] problem with a conditional statement

2007-05-09 Thread Kirk Wythers
On May 9, 2007, at 10:41 AM, Erik Jones wrote: On May 9, 2007, at 10:32 AM, Kirk Wythers wrote: Here is a more elaborate version, I'm trying to add 'avgsol' to your original FROM clause: SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE s.obs_id END AS obs_id, si

Re: [GENERAL] problem with a conditional statement

2007-05-09 Thread Erik Jones
On May 9, 2007, at 10:32 AM, Kirk Wythers wrote: Here is a more elaborate version, I'm trying to add 'avgsol' to your original FROM clause: SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE s.obs_id END AS obs_id, site_near.station_id, site_near.longname, w.year, w.

Re: [GENERAL] problem with a conditional statement

2007-05-09 Thread Kirk Wythers
Here is a more elaborate version, I'm trying to add 'avgsol' to your original FROM clause: SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE s.obs_id END AS obs_id, site_near.station_id, site_near.longname, w.year, w.doy, w.precip, w.tmin, w.tmax, --replace missing val

Re: [GENERAL] problem with a conditional statement

2007-05-08 Thread Albe Laurenz
Kirk Wythers wrote: >>> I am struggling to get a CASE WHEN statement to work within another >>> CASE WHEN. Here is my original code: >>> >>> SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE >>> s.obs_id END AS obs_id, site_near.station_id, site_near.longname, >>> w.year, w.d

Re: [GENERAL] problem with a conditional statement

2007-05-08 Thread Kirk Wythers
On May 8, 2007, at 2:02 AM, Albe Laurenz wrote: Kirk Wythers wrote: I am struggling to get a CASE WHEN statement to work within another CASE WHEN. Here is my original code: SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE s.obs_id END AS obs_id, site_near.station_id

Re: [GENERAL] problem with a conditional statement

2007-05-08 Thread Albe Laurenz
Kirk Wythers wrote: > I am struggling to get a CASE WHEN statement to work within another > CASE WHEN. Here is my original code: > > SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE > s.obs_id END AS obs_id, site_near.station_id, site_near.longname, > w.year, w.doy, w.

[GENERAL] problem with a conditional statement

2007-05-07 Thread Kirk Wythers
I am struggling to get a CASE WHEN statement to work within another CASE WHEN. Here is my original code: SELECT CASE WHEN w.station_id = site_near.station_id THEN w.obs_id ELSE s.obs_id END AS obs_id, site_near.station_id, site_near.longname, w.year, w.doy, w.precip, w.tmin, w.tmax, --repl