克利奥帕特拉薯片:数据库语句问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 20:23:49
请写出在class表中查找满足如下条件的记录的sql语句:
1.返回字段c_name,c_stu
2.返回纪录数:前5条
3.查询条件:c_stu值大于30,并且c_type为真,并且c_name字段值中有"二班"两个字
4.查询结果按c_stu正排序,按c_type倒排序
我写的sql语句那里错了
select top5 c_name,c_stu from class where c_stu>30,c_type=true and c_name like "*二班*" order by c_stu asc,c_type desc请高手帮忙改一下
如果有三个条件或三个以上的条件,之间应该怎样用where语句来写啊

select top5 c_name,c_stu from class where (c_stu>30) and (c_type=true) and (c_name like '*二班*') order by c_stu asc,c_type desc

条件之间用and/or等连接,不要用逗号