I would like to make a SELECT and to use with CASE cause or something else because I have to handle more ELSE.
Something like this:
SELECT STATUS FROM apple_tree WHERE STATUS = (CASE WHEN STATUS = '1' THEN '1'
else (CASE WHEN STATUS = '2' THEN '2' end)
else (CASE WHEN STATUS = '3' THEN '3' end)
else (case when STATUS = '4' then '4' end)
else '1' end)
Just my problem that my statement never execute only just the main else.
Something like this:
SELECT STATUS FROM apple_tree WHERE STATUS = (CASE WHEN STATUS = '1' THEN '1'
else (CASE WHEN STATUS = '2' THEN '2' end)
else (CASE WHEN STATUS = '3' THEN '3' end)
else (case when STATUS = '4' then '4' end)
else '1' end)
Just my problem that my statement never execute only just the main else.