oracle 中查询学生语文成绩大于数学成绩语句

2025-02-24 00:29:54
推荐回答(2个)
回答1:

table:grade
语文列:Chinese
数学列:math

SQL: select *
from grade

wnere chinese > math;

如果成绩表跟学生信息表有关联的话通过id键来关联:
table:grade
语文列:Chinese
数学列:math
id键:外键引用学生信息表主键

学生信息表:student
id:主键
message:其他一些个人信息

SQL:
select a.message,b.chinese,b.math

from student a,grade b

where a.id = b.id

and b.chinese > b.math

根据具体情况改动:望采纳

回答2:

select * form 成绩表 where 语文-数学>0