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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Condition in SQL

Re: Condition in SQL

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 27 Nov 2007 20:03:44 -0800
Message-ID: <1196222617.331610@bubbleator.drizzle.com>


francan00_at_yahoo.com wrote:
> I have this query with a condition in Access and would like to know
> how I can put a condition part in Oracle 9i SQL similiar to how Access
> does it?
>
>
> Current Access SQL that I want to rewrite in Oracle where I just need
> to know how to do the condtion part: IIF( ISNULL(d.NOTES)=True,'Not
> Available',d.NOTES) AS NOTES
>
>
> SELECT
> b.FirstName,
> b.LastName,
> c.FirstName,
> c.LastName,
> a.Info,
> IIF( ISNULL(d.NOTES)=True,'Not Available',d.NOTES) AS NOTES
> FROM
> Person AS b,
> Person AS c,
> Notes AS d,
> Main AS a
> WHERE
> a.MID= 34
> And
> b.PID=a.PO
> And
> c.PID=a.TE
> And
> d.MID=a.MID

Look at the NVL and NVL2 functions.

www.psoug.org
click on Morgan's Library
click on Built-in functions near the top of the page.

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue Nov 27 2007 - 22:03:44 CST

Original text of this message

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