题解 | #找到每个人的任务#
找到每个人的任务
http://www.nowcoder.com/practice/9dd9182d029a4f1d8c1324b63fc719c9
SELECT p.id,p.name,t.content FROM person p left join task t on p.id=t.person_id order by p.id
考察左外连接,外连接查询内连接+主表中有而从表中没有的记录
本题主表为左表,故为左外连接
找到每个人的任务
http://www.nowcoder.com/practice/9dd9182d029a4f1d8c1324b63fc719c9
SELECT p.id,p.name,t.content FROM person p left join task t on p.id=t.person_id order by p.id
考察左外连接,外连接查询内连接+主表中有而从表中没有的记录
本题主表为左表,故为左外连接
相关推荐