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: Hierarchical query

Re: Hierarchical query

From: kerul4u <kerul4u_at_gmail.com>
Date: 21 Mar 2005 21:12:40 -0800
Message-ID: <1111468360.621796.152320@z14g2000cwz.googlegroups.com>


Hi,
I'm new to this group..but always love to play with database

here is a short and sweet solution 4 u
try it out....(this is well working in SQL Server 2000 and i wish it should work in Oracle
also)

select col2, (case when col2='E1' or col2='E2' or col2='E3' then 'Salary' else 'Benefit' end ) as 'test1' from test where col1 not in (4,9)

col2 test1
---------- -------

E1         Salary
E2         Salary
E3         Salary
E4         Benefit
E5         Benefit
E6         Benefit
E7         Benefit

Regards
Kerul Received on Mon Mar 21 2005 - 23:12:40 CST

Original text of this message

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