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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: if-then-else in SELECT

RE: if-then-else in SELECT

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 3 Mar 2004 13:50:10 -0500
Message-ID: <A186CBDC8B1D61438BC50F1A77E91F73057C1AF6@xchgbrsm1.corp.espn.pvt>


select *
  from emp
 where (name = 'AIMEE GORE')
union
select *
  from emp
 where (name in ('AIMEE','GORE'))
/

Should get you close ...
Raj



Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. select standard_disclaimer from company_requirements; QOTD: Any clod can have facts, having an opinion is an art !

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of elain he Sent: Wednesday, March 03, 2004 1:33 PM
To: oracle-l_at_freelists.org
Subject: if-then-else in SELECT

Hi,
I would like to retrieve records based on the following if-then-else criteria.

for eg.
retrieve all empolyee names='AIMEE GORE' if there is no exact match,
retrieve employee names='AIMEE' or employee_name='GORE'

How can I write the SQL?

DB - 8i

thanks.

elain



Learn how to help protect your privacy and prevent fraud online at Tech Hacks & Scams. http://special.msn.com/msnbc/techsafety.armx

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Mar 03 2004 - 12:47:20 CST

Original text of this message

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