I have two tables Activity and Action. One or more actions can be performed for an activity. And the relationships between Activity and Action is given in a third table called Activity Action.
How do I retrieve a result set that tells me what action is applicable for each activity using an sql statement? Here's the table structure
Activity Table -ActivityId(PK), ActivityText
Action Table - ActionId(PK), ActionText
ActivityAction -ActivityActionId(PK), ActivityID, ActionID
I want a resultant table in the format
Activity, Applicable Action
(the Activity column should show ActivityText and Applicable Action should show ActionText)
could you please guide me?
Thank you.
question from:
https://stackoverflow.com/questions/2008853/join-two-tables-based-on-relationship-defined-in-third-table 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…