使用简单sql语句选出 (课程1分数大于课程2分数的学生) 并输出学生编号和课程分数.
表student有如下字段
sno学生编号 |cno课程编号 |score课程分数
使用简单sql语句选出 (课程1分数大于课程2分数的学生) 并输出学生编号和课程分数.
//使用查询代替 from的表名
select amb.sno, amb.score from
(select sno,score from student where cno=1) as amb,
(select sno,score from student where cno=2) as amd
where amb.score>amd.score
and
amb.sno=amd.sno;
版权声明:本文为amh13853151336原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。