SQL语句求教,在线等

来源:百度知道 编辑:UC知道 时间:2024/05/12 05:19:00
要查询CLASS表中字段c_stu值大于50,或者小于20的记录,并只返回c_name和c_stu字段,应该如何写SQL语句?

select c_name,c_stu
from CLASS
where c_stu>50 and c_stu<20

不知道这样行不
select c_name,c_stu
from CLASS
where 20<c_stu<50

注意符号都是英文的

select c_name,c_stu
from CLASS
where c_stu>50 or c_stu<20

楼上的兄弟写的有问题,大于50同时必须小于20的数好像太荒唐了。

要查询CLASS表中字段c_stu值大于50,或者小于20的记录,并只返回c_name和c_stu字段,应该如何写SQL语句?
select c_name,c_stu from class where c_stu>50 or c_stu<20
不知道这样行不行,如果不行的话可以再将变量定义下,SQL都被卸了,不好实验