I need to combine these two queries where the second query will just be another column with in the first query. I want all the results from the first query displayed despite any conditions that were placed on the second query.
Code:
SELECT PR.WBS1, PR.WBS2, PR.WBS3, LB.AmtBud
FROM PR LEFT OUTER JOIN
LB ON LB.WBS1 = PR.WBS1 AND LB.WBS2 = PR.WBS2 AND LB.WBS3 = PR.WBS3
WHERE (PR.WBS1 = '001-298') AND (PR.WBS3 <> 'ZZZ')
ORDER BY PR.WBS2, PR.WBS3
SELECT PR.WBS1, PR.WBS2, PR.WBS3, SUM(LD.BillExt) AS Expr1
FROM PR LEFT OUTER JOIN
LD ON LD.WBS1 = PR.WBS1 AND PR.WBS2 = LD.WBS2 AND PR.WBS3 = LD.WBS3
WHERE (PR.WBS1 = '001-298') AND (PR.WBS3 <> 'ZZZ') AND (LD.BilledPeriod = '200408')
GROUP BY PR.WBS1, PR.WBS2, PR.WBS3
ORDER BY PR.WBS2, PR.WBS3
Any suggestions?
Thanks