select case consider the first field only, MySQL 4.18

2005-02-18 Thread Jan Bartholdy
Dear List, I have a select case question SELECT CASE WHEN `Species_1_l` 0 THEN 'intern' when 'Species_3_e' 0 THEN 'extern' ELSE '' END AS `species_1_l` from species where statsample=1820; The result is only -- species_1_l

Re: select case consider the first field only, MySQL 4.18

2005-02-18 Thread Roger Baklund
Jan Bartholdy wrote: Dear List, I have a select case question SELECT CASE WHEN `Species_1_l` 0 THEN 'intern' when 'Species_3_e' 0 'Species_3_e' is surrounded by single quotes, not backticks... thus it is treated as a string, numeric value is 0, which is never 0. BTW,