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

Enter image details here

< P> desired result location | Achievement Level | Data | Geographical location. Data | Here's the timeframe that I enter image details here

I'm sure you leave 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;

A 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

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -