when i use a statement as case condition it always returns false;
select * from table order by (case when (true) then id else 1/0 end) desc -- works
select * from table order by (case when (select true) then id else 1/0 end) desc -- exception
select * from table order by (case when (1=1) then id else 1/0 end) desc -- works
select * from table order by (case when (select 1=1) then id else 1/0 end) desc -- exception
what is wrong with that condition?