关于SQL语句,高手进来,重赏!!!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/09/28 17:50:49
要查询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

其实下面的两条查询语句都可以,就看你习惯用那条咯:
1,select c_name,c_stu from class where c_stu>50 or c_stu<20
2,select c_name,c_stu from class where c_stu not between 20 and 50

select c_name,c_stu from class where c_stu>50 or c_stu<20 支持这个,我觉得就是这样写。

select c_name,c_stu from class where c_stu between 20 and 50