Join two tables based on relationship defined in third table

前端 未结 3 1650
别那么骄傲
别那么骄傲 2020-12-24 01:36

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 call

3条回答
  •  轮回少年
    2020-12-24 01:52

    SELECT ActivityText, ActionText
    FROM Activity
    JOIN ActivityAction ON Activity.ActivityId = ActivityAction.ActivityId
    JOIN Action ON ActivityAction.ActionId = Action.ActionId
    WHERE Activity.ActivityId = 1;
    

提交回复
热议问题