sql - Joining three tables together -
I have two tables that I was able to connect properly. I'm trying to get one-third in the table, even if there is no data in the specific year, I still want the value of zero or 0. My problem is that when I get involved in that table, I am getting duplicate records or no records are displayed at all
Here's what I have tried:
[In the fourth grade math achievement level] from the SELECT * M Inner Join [4th grade reading achievement level] R on M. Location = R. Location and M. Timeframe = Achievement Level] = R [Achievement Level] Join the official right [the fourth graders that run under the skilled reading level from the geographic location] Location = G Location and m.TimeFrame = g.TimeFrame where M. Location = 'Ohio' and M. Timeframe = 2011< P> desired result location | Achievement Level | Data | Geographical location. Data | Here's the timeframe that I
I'm sure you leave a A external outer left
and no is not the right external participant
: SELECT * [Fourth grade reading level of achievement] R on M.Liation = R. Location and M.Timeframe = R. Timeframe and M [achievement level] = R. [Achievement level] Join the left offer [the fourth graders that have been scored below the level of skilled reading from the geographical location] Place = g. Location and M.timeframe = G.time frame where M. Location = 'Ohio' and Me Timeframe = 2011;
left external participant
matches all results with m
and r
, NULL
for values in g
that do not match. As your query, all the rows were being taken from the g
table ( right external join
). However, because the non-matching rows in the m
table will have the value NULL
, these will be filtered, the result is that the right external interaction
actually Is treated like a internal included
.
Comments
Post a Comment