Link to home
Start Free TrialLog in
Avatar of freeka
freeka

asked on

Cannot use LEFT OUTER JOIN, must use old ( + ) type of join syntax.

Hi there

Here is the query:

select count(*)
from ipgsubsdisc a left outer join costedevent b on a.account_num=b.account_num and a.bill_seq=b.event_seq and a.mpn=b.event_source
where b.account_num is null

Please advise.

Avatar of derekkromm
derekkromm
Flag of United States of America image

select count(*) from ip a, costedevent b
where a.account_num (+) = b.account_num and
a.bill_seq (+) = b.event_seq and
a.mpn (+) = b.event_source and
b.account_num is null
Avatar of Lowfatspread
for sql server 7 & sql server 2000
use *= for the left outer join conditions

which database are you using?

select count(*)
from ipgsubsdisc a ,
costedevent b
where b.account_num is null
and  a.account_num*=b.account_num
and a.bill_seq*=b.event_seq
and a.mpn*=b.event_source

Avatar of freeka
freeka

ASKER

I added a.bill_date = '20070202' to both my query and the queries above suggested as answer and both the above bring back a result of zero whereas the original brings back 3000+ records ?!

Please advise.
Avatar of freeka

ASKER

not to confuse anyone but bill_date is a VARCHAR2 datatype not a date so essentially all i did was add a string value to the constraint.
What format is the date stored in the varchar2 column?
Avatar of freeka

ASKER

Nevermind, I solved it. And it was none of the answers above so go figure EE admins.
ASKER CERTIFIED SOLUTION
Avatar of freeka
freeka

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial