题解 | #浙江大学用户题目回答情况#

浙江大学用户题目回答情况

https://www.nowcoder.com/practice/55f3d94c3f4d47b69833b335867c06c1

select a.device_id,b.question_id,b.result from user_profile a,question_practice_detail b where university = "浙江大学" and a.device_id = b.device_id
select a.device_id,b.question_id,b.result from user_profile a inner join question_practice_detail b on a.device_id = b.device_id and a.university = "浙江大学"

两种都是连接查询,第一个是省略 inner join 的一种方式。

另外可以使用子查询进行查询。

select device_id,question_id,result from question_practice_detail where device_id in(
    select device_id from user_profile where university = "浙江大学"
)

全部评论

相关推荐

04-15 14:28
已编辑
Java
程序员小白条:学院+两段经典项目+技术栈,最大众的简历,纯看运气
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务