Subject | case alias |
---|---|
Author | totako_tr |
Post date | 2005-04-30T07:50:04Z |
hi all;
in my sql i use "case when"
case when a.f1 = 0 then 'zero' else 'not zero' end as TTT
i want to use this result of case in another field
I must write again "case" statement..
"Select case when a.f1 = 0 then 'zero' else 'not zero' end as TTT,
'Result = ' || (case when a.f1 = 0 then 'zero' else 'not zero' end)
from xTbl"
but i don't want use it like this.. When i've a lot of "case"
statements my sql is growing..
I want like this..
"Select case when a.f1 = 0 then 'zero' else 'not zero' end as TTT,
'Result = ' || TTT from xTbl"
can I do it?
in my sql i use "case when"
case when a.f1 = 0 then 'zero' else 'not zero' end as TTT
i want to use this result of case in another field
I must write again "case" statement..
"Select case when a.f1 = 0 then 'zero' else 'not zero' end as TTT,
'Result = ' || (case when a.f1 = 0 then 'zero' else 'not zero' end)
from xTbl"
but i don't want use it like this.. When i've a lot of "case"
statements my sql is growing..
I want like this..
"Select case when a.f1 = 0 then 'zero' else 'not zero' end as TTT,
'Result = ' || TTT from xTbl"
can I do it?