方舟盗版开服务器:SQL编写的问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 15:54:33
写出在class表中查找满足如下条件的记录的SQL语句:
1.返回字段 c_name,c_stu
2.返回记录数: 前5条
3.查询条件: c_stu值 大于30,并且 c_type值为真,
并且c_name字段值中有"二班"两个字
4.查询结果按c_stu正排序,按c_type 倒排序(注:
在正排序时请不要省略排序关键字)

select top 5 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

大家可以去试一下
网址:http://www.pconline.com.cn/pcedu/videoedu/asp/0606/814804.html

select c_name,c_stu form where c_stu>30 and c_type =true and c_name like '%二班%'and rownum<=5 order by desc