Hi there, is there a simple way to replace NULL values in multiple columns within the SQL statement? I changed the underlaying country template of your database; so now there are a couple of NULL values when I join the stats-table with the country table. Unfortunately, my queries have always multiple (year) columns, so I can't do a kind of manual replace. I found that the COALESCE command does something like this, but I couldn't figure out how this works. And this solution which I found on the Net: => SELECT * FROM test; a --- 1 2 3 => SELECT a, CASE WHEN a=1 THEN 'one' WHEN a=2 THEN 'two' ELSE 'other' END FROM test; a | case ---+------- 1 | one 2 | two 3 | other doesn't work either, cause the titles of my columns are very varied... Thanks for any advice, Stefan Schwarzer _______________________________________ Stefan Schwarzer GIS & Data Management UNEP/DEWA/GRID-Europe Chemin des Anemones 11 CH - 1219 Chatelaine Switzerland Tel: (+41) 22.917.83.49 Fax: (+41) 22.917.80.29 Internet: http://geodata.grid.unep.ch/ _______________________________________ |
- [GENERAL] Replace NULL values Stefan Schwarzer
- Re: [GENERAL] Replace NULL values Martijn van Oosterhout
- Re: [GENERAL] Replace NULL values Stefan Schwarzer
- Re: [GENERAL] Replace NULL values Martijn van Oosterhout
- Re: [GENERAL] Replace NULL values Sim Zacks
- Re: [GENERAL] Replace NULL values Stefan Schwarzer
- Re: [GENERAL] Replace NULL va... Martijn van Oosterhout
- Re: [GENERAL] Replace NULL va... Sim Zacks
- Re: [GENERAL] Replace NUL... Stefan Schwarzer
- Re: [GENERAL] Replace... Sim Zacks
- Re: [GENERAL] Replace... Andrew Sullivan