Case Expression used in Select Statement [message #326375] |
Wed, 11 June 2008 04:59 |
renu4dwh
Messages: 24 Registered: April 2008 Location: Pune
|
Junior Member |
|
|
Can someone explain through an example about using Case Expressions in a select statement and the purpose of the case statement in the select statement.
Regards,
Renu
|
|
|
|
|
Re: Case Expression used in Select Statement [message #326393 is a reply to message #326375] |
Wed, 11 June 2008 06:02 |
oraclestudent
Messages: 8 Registered: June 2008 Location: hyderbad
|
Junior Member |
|
|
Basically CASE expression can do all the DCODE does and in addition to that IF-THEN analysis, like use of any comparision operatior and checking multiple conditions.
Examples :
select sal,case when sal < 2000 then 'Band A'
when sal < 3000 then 'Band B'
when sal < 4000 then 'Band C'
else 'Band 5'
end
from emp;
|
|
|
|