On May 8, 10:24=A0am, "Michael Mattias" <mmatt...@[EMAIL PROTECTED]
> wrote:
> "jeff" <jmoore...@[EMAIL PROTECTED]
> wrote in message
>
>
news:c06426f2-e7e7-428c-9350-b3343d6a612c@[EMAIL PROTECTED]
>
>
>
>
>
> >I am having a problem with a left outer join when I add conditionals.
>
> > Select
> > =A0 =A0 =A0 =A0A. vehicle,
> > =A0 =A0 =A0 =A0B.Vehicle,
> > =A0 =A0 =A0 =A0B.acct,
> > =A0 =A0 =A0 =A0B.MOYR,
> > =A0 =A0 =A0 =A0B.Trancode
> > from =A0Table1 A, Table2 B
> > where A.vehicle=3DB.vehicle(+)
> > =A0and =A0 B.acct=3D'1234'
> > =A0and =A0 B.MOYR =3D '0502'
> > =A0and =A0B.trancode=3D'80'
> > =A0order by a.vehicle
>
> > I need all a.vehicles for all vehicles to come back in the cursor
> > regardless. Any ideas?
>
> ALL A.vehicles?
>
> Then you can't us the conditionals that way, since that will omit any
> a.vehicles which don't have any rows in b matching the conditions.
>
> You can change your select to return a 'nvl' =A0(oracle) or 'nullif'
> (something) or CASE (I think that is standard) to return the rows where
th=
e
> "b" results set columns will be null and eliminate the WHEREs , but
there
> are others here who write SQL far far better than do I.
>
> MCM- Hide quoted text -
>
> - Show quoted text -
Yeah that was kind of an overview, I did use NVL for the B.Table
fields to account for nulls. Thanks for your help


|