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: IF Statement help in SQL

Re: IF Statement help in SQL

From: NoName <nobody_at_nowhere.com>
Date: Thu, 4 Dec 2003 15:06:54 +0100
Message-ID: <bqne3g$h2h$1@grillo.cs.interbusiness.it>


Hello,
you can use "decode" function (that is a sort of IF), and use just one field instead of two, but in your specific case, a "nvl" function should be enough.

SELECT     apps.payroll_area

,apps.employee_number
,apps.address1
,apps.address2
,apps.address3
,NVL(APPS.ADDRESS4,APPS.ADDR_COUNTRY) new_address

In this case, if apps.address4 is null, it assumes the value of addr_country.
The new field is called "new_address", so you should change it in your subsequent statements.
Regards. Received on Thu Dec 04 2003 - 08:06:54 CST

Original text of this message

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