查询数据库原理成绩高于本班所有女生数据库原理成绩的男生的学号和姓名的SQL语句

来源:百度知道 编辑:UC知道 时间:2024/04/29 19:28:31

select 学号,姓名 from 数据库原理 where 性别='男' and 成绩>
(select max(成绩) from 数据库原理 where 性别='女' )

select sno,sname from TABLE where sex='male' and fenshu>(select max(fenshu) from TABLE where sex='female' )
字段解释:sno 学号 sname 姓名
sex 性别 fenshu 分数

select 学号,姓名 from 数据库原理 where 性别='男' and 成绩>
(select max(成绩) from 数据库原理 where 性别='女'