Skip to content
Advertisement

join of two queries missing values

I need help joining these two queries. Here’s the first dataset with its query:

:

and second:

:

My query produces this result:

I need to return as

I can’t figure out why my query is leaving out the records with no Inbound data. I believe a right join is correct. It seems like an issue with using the correct Terminal field. I think a second pair of eyes would help.

Advertisement

Answer

You seem to want:

Your problem may be incorporating where conditions into the outer joins. I strongly recommend using LEFT JOIN. Conditions on the first table go in the WHERE clause. Conditions on the second (and subsequent tables) go in the ON clause.

I’m not sure what your code has to do with the problem you stated.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement