Home » SQL & PL/SQL » SQL & PL/SQL » Case Expression used in Select Statement
Case Expression used in Select Statement [message #326375] Wed, 11 June 2008 04:59 Go to next message
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 #326376 is a reply to message #326375] Wed, 11 June 2008 05:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL Reference

Regards
Michel
Re: Case Expression used in Select Statement [message #326390 is a reply to message #326375] Wed, 11 June 2008 05:42 Go to previous messageGo to next message
sarwagya
Messages: 87
Registered: February 2008
Location: Republic of Nepal
Member
http://www.adp-gmbh.ch/ora/sql/case_when.html
Re: Case Expression used in Select Statement [message #326393 is a reply to message #326375] Wed, 11 June 2008 06:02 Go to previous messageGo to next message
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;

Re: Case Expression used in Select Statement [message #326438 is a reply to message #326393] Wed, 11 June 2008 09:16 Go to previous message
renu4dwh
Messages: 24
Registered: April 2008
Location: Pune
Junior Member
thanks for so much inputs...they gonna help me for sure...
Previous Topic: How to load excel file in SQL Loader?
Next Topic: need help with basic sql
Goto Forum:
  


Current Time: Sat Dec 10 05:22:08 CST 2016

Total time taken to generate the page: 0.08733 seconds