Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: field alias for case function
sychen_at_vidmon.com (sy) wrote in message news:<44dec6fa.0305011017.5f6efbc_at_posting.google.com>...
> Hi,
>
> How do I give a field alias for the following sql statement:
>
> select case id when 1 then 9 else id end case from temp_t1;
>
> I would to give a field name for the output.
>
> Thanks
> sy
SQL> select * from test3;
C1 C2 C3
-- ---------- ----------
a 1 b 2 c 3 e 4
SQL> select case c2 when 1 then '1st row'
2 when 2 then '2nd row' 3 when 3 then '3rd row' 4 when 4 then 'last row'
TITLE
![]() |
![]() |