题解 | #浙江大学用户题目回答情况#
浙江大学用户题目回答情况
http://www.nowcoder.com/practice/55f3d94c3f4d47b69833b335867c06c1
知识点:内连接
显示内连接
内连接又称等值连接,使用 INNER JOIN 关键字。
SELECT A.value, B.value
FROM tablea AS A INNER JOIN tableb AS B
ON A.key = B.key;
隐式内连接
可以不明确使用 INNER JOIN,而使用普通查询并在 WHERE 中将两个表中要连接的列用等值方法连接起来。
SELECT A.value, B.value
FROM tablea AS A, tableb AS B
WHERE A.key = B.key;
本题解答(隐式内连接解法)
select qpd.device_id, qpd.question_id, qpd.result from question_practice_detail as qpd
, user_profile as up where qpd.device_id = up.device_id and up.university = "浙江大学";