Joining three tables using MySQL

前端 未结 9 2302
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 10:40

I have three tables named

**Student Table**
-------------
id    name
-------------
1     ali
2     ahmed
3     john
4     king

**Course Table**
------------         


        
9条回答
  •  既然无缘
    2020-11-22 11:12

    Use this:

    SELECT s.name AS Student, c.name AS Course 
    FROM student s 
      LEFT JOIN (bridge b CROSS JOIN course c) 
        ON (s.id = b.sid AND b.cid = c.id);
    

提交回复
热议问题