On Fri, 9 May 2008 15:11:11 +1200, "Pete Dashwood"
<dashwood@[EMAIL PROTECTED]
>
wrote:
>
>
>"Robert" <no@[EMAIL PROTECTED]
> wrote in message
>news:g5b7245ohs5ob6nrikqm0uaql8e1n708ul@[EMAIL PROTECTED]
>> On Thu, 8 May 2008 06:58:32 -0700 (PDT), jeff <jmoore207@[EMAIL PROTECTED]
>
wrote:
>>
>>>I am having a problem with a left outer join when I add conditionals.
>>>
>>>Select
>>> A. vehicle,
>>> B.Vehicle,
>>> B.acct,
>>> B.MOYR,
>>> B.Trancode
>>> from Table1 A, Table2 B
>>> where A.vehicle=B.vehicle(+)
>>> and B.acct='1234'
>>> and B.MOYR = '0502'
>>> and B.trancode='80'
>>> order by a.vehicle
>>>
>>>I need all a.vehicles for all vehicles to come back in the cursor
>>>regardless. Any ideas?
>>
>> On second thought, just add left outer join (+) to all the right
columns:
>>
>> Select
>> A. vehicle,
>> B.Vehicle,
>> B.acct,
>> B.MOYR,
>> B.Trancode
>> from Table1 A, Table2 B
>> where A.vehicle=B.vehicle(+)
>> and B.acct(+)='1234'
>> and B.MOYR(+) = '0502'
>> and B.trancode(+)='80'
>> order by a.vehicle
>
>Hmmm... it seems there are facilities in Oracle that are not usual.
>Nevertheless, a very elegant solution.
Logically, a=foo(+) means a=foo or foo is null
foo(+)=a means foo=a or foo is null
you could also think of it meaning a=nvl(foo,a)


|