I currently have a query that Joins 2 Tables (Table1 and Table2) using
LEFT OUTER JOIN. Here is an example of that query:
SELECT a.supply,
a.state,
b.cost
FROM Table1 a
LEFT OUTER JOIN Table2 b
ON a.supply = b.supply
AND a.state = b.state
GROUP BY a.supply, a.state, b.cost
I would like to add additional data to this query by adding a 3rd Table. I made
this separate query which Joins Table1 and Table3:
SELECT a.supply,
FROM Table1 a
LEFT OUTER JOIN Table3 c
ON a.supply = c.supply
GROUP BY a.supply, c.number, c.number2
My problem is that I don't want to join Tables 2 and 3 because Table3 does not
have one of the columns that Table1 and 2 use to JOIN. So, I just want to JOIN
Tables 1 & 3 and keep my 1st query which joins Tables 1 & 2. Is there a way to
add my 2nd query to my 1st query without messing up the JOIN? If anyone could
give me some coding examples, I'd greatly appreciate it. Thanks!
LEFT OUTER JOIN. Here is an example of that query:
SELECT a.supply,
a.state,
b.cost
FROM Table1 a
LEFT OUTER JOIN Table2 b
ON a.supply = b.supply
AND a.state = b.state
GROUP BY a.supply, a.state, b.cost
I would like to add additional data to this query by adding a 3rd Table. I made
this separate query which Joins Table1 and Table3:
SELECT a.supply,
FROM Table1 a
LEFT OUTER JOIN Table3 c
ON a.supply = c.supply
GROUP BY a.supply, c.number, c.number2
My problem is that I don't want to join Tables 2 and 3 because Table3 does not
have one of the columns that Table1 and 2 use to JOIN. So, I just want to JOIN
Tables 1 & 3 and keep my 1st query which joins Tables 1 & 2. Is there a way to
add my 2nd query to my 1st query without messing up the JOIN? If anyone could
give me some coding examples, I'd greatly appreciate it. Thanks!
Comment