Correct SQL Statement for Joining Taxonomy Terms I have 2 different taxonomy vocabularies setup. 


Courses (First Aid, H2S Alive, Air Monitoring, Gas Detection,
etc...)
Locations (Vancouver, Calgary, Toronto, Montreal)


I have a content type called Landing Page for each of the courses that has a taxonomy reference field so you can assign a course or multiple courses to that node. 

I have a second content type for Courses which also has the 2 taxonomy vocabularies set as taxonomy reference fields on its nodes. These course nodes get displayed in a calendar format and is setup with the entity registration module.

WHAT I NEED HELP WITH:

Im looking for a way to output a set of buttons on the Landing Page nodes that will give me a the list of locations that have been assigned to any node that is based on the given Courses taxonomy term.

For example;

3 Different Courses nodes all have First Aid assigned to them. However, they have 3 different locations set to them.

I've created a landing page for the First Aid Course assigned it the First Aid taxonomy term. I need to display a set of locations that this course has courses offered at.
If you want to show Locations a Course is offered. Or Courses at a Location I would recommend using the Views Field module, or perhaps Context to show a View on the content type page.

Views field allows you send parameters to the embedded field view from the source Node. So you should be able to get the related content(s) you want to show by passing the necessary filter parameter criteria you want to the View -- usually as a contextual filter.

For example for a Landing Page Content Type (eg, First Aid) you add a field that is a View. Call the view like locations for course. Then make a View that outputs Location taxonomy term names based on a contextual filters. The contextual filter will be:


the taxonomy term name of the course(s) in your taxonomy of Courses.


Then output the taxonomy Location term names for results of the set course name contextual filter. Overwrite the linkpath as needed.