mysql,多表的内外连接+子查询
时间:2021-07-01 10:21:17
帮助过:1人阅读
select s.s_name,c.c_name
from student s
left outer join student_course sc on (s.sid=
sc.sid)
left outer join house h on (s.hid=
h.hid)
left outer join course c on (sc.cid=
c.cid)
where s.sid
in (
select sid
from student) and h.hid=
1;
+---------+----------+
| s_name | c_name |
+---------+----------+
| freedom | odijfoij |
| freedom | in2 |
| wer | odijfoij |
+---------+----------+
mysql,多表的内外连接+子查询
标签: