Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: field alias for case function

Re: field alias for case function

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 1 May 2003 14:59:56 -0700
Message-ID: <130ba93a.0305011359.39cbe715@posting.google.com>


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'

  5 end as title from test3;

TITLE



1st row
2nd row
3rd row
last row Received on Thu May 01 2003 - 16:59:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US