Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: IF Statement help in SQL
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
![]() |
![]() |