two inner selects with a left join?
I'm trying to take two selects and left join them.
I originally had it as and outer select with a Left JOIN on the inner select. I however due to duplicate rows need to make my query into two inner selects
to remove the duplicates, but still need to do a left join. Any ideas on how to structure this or if it's possible even?
My two queries are verbatim of each other other than a variable change that looks like the following:
Code:
SELECT count(*) as total, min(soh.Anumber), min(soh.Onumber) as Onumber
FROM dwasf,
soh,
cct,
dis,
act
WHERE soh.sea = 'FL 05'
AND soh.Ostatus = 'IN'
AND soh.Onumber = dwasf.Sid
AND dwasf.business_key = '2'
AND soh.aAnumber = act.Anumber
AND soh.d_date = cct.Cdate
AND soh.dist = dis.id
group by soh.Anumber
order by count(*), soh.Anumber desc
just how to Left join on two queries is eluding me....