Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> CASE WHEN propagating two columns in a SELECT
Hi all,
is there a way to propagate two columns with a CASE WHEN statement in a SELECT. What I tried and I think it shows what I want to do is:
SELECT
CASE
WHEN TASK_ID > 1 THEN (1,'green')
ELSE (0,'red')
END AS (COL_A, COLOR)
FROM
TEST_TABLE
I can to this by doing this but in a complex query it is
not clearly arranged and I always have the same WHEN twice:
SELECT
CASE
WHEN TASK_ID > 1 THEN 1
ELSE 0
END AS COL_A,
CASE
WHEN TASK_ID > 1 THEN 'green'
ELSE 'red'
END AS COLOR
FROM
TEST_TABLE
Any Ideas?
Thanks Björn Received on Thu Aug 16 2007 - 02:23:00 CDT
![]() |
![]() |