标签:课程 查询 tps 习题 art join style 使用 detail
题目来源:https://blog.csdn.net/flycat296/article/details/63681089
1. 查询" 01 "课程比" 02 "课程成绩高的学生的信息及课程分数
使用隐式
FROM student s3, ( SELECT s1.stu_id sid, s1.`score` score1, s2.`score` score2 FROM score s1, score s2 WHERE s1.stu_id = s2.stu_id AND s1.`course_id` = 1 AND s2.`course_id` = 2 AND s1.`score` > s2.`score`) s4 WHERE s3.id = s4.sid;
显式
SELECT a.*, b.`score` score1, c.`score` score2 FROM student a JOIN score b ON a.`id`=b.`stu_id` JOIN score c ON b.course_id = 1 AND c.`course_id`=2 AND a.`id`=c.`stu_id` AND b.`score`>c.`score`;
标签:课程 查询 tps 习题 art join style 使用 detail
原文地址:https://www.cnblogs.com/try4396/p/12179567.html