select语句问题,帮忙看看

来源:百度知道 编辑:UC知道 时间:2024/09/21 06:33:53
请写出在class表中查找满足如下条件的记录的SQL语句
1,返回字段 c_name,c_stu
2,返回记录数:前5条
3,查询条件:c_stu值大于30,并且 c_type值为真,并且c_name字段值中有
"二班"两个字
4,查询结果按c_stu正排序,按c_type倒排序(注:真排序不要省略关键字)
我写的答案是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
为什么不对?哪里错了吗?/
----------------------------------------------
我的答案是select top5 c_name,c_stu from class where c_stu>30 and c_type is true and c_name like "*二班*" order by c_stu asc,c_type desc
为什么是错的..好多人给我答案都是错的,,你们最好在
http://www.enet.com.cn/eschool/inforcenter/fullscreen.jsp?flash=http://images.enet.com.cn/eschool/asp/adry45yfgdfasp6.3.3.swf
这个网站上测试一下,通过以后,再发给我,谢谢.上面的网站人格担保,绝对没病毒

原来如此,我告诉你为什么都是错的,因为这个flash制作有问题!死读书只会害你的,换个地方学吧

你的class表有没有问题?c_type的值是什么?要是1或0就改为c_type=1或0(哪个为真就写哪个)
select top 5 c_name,c_stu from class where c_stu>30 and c_type is true and c_name like '%二班%' order by c_stu asc,c_type desc

select top 5 c_name,c_stu from class where c_stu>30 and c_type is true and c_name like '%二班%' order by c_stu asc,c_type desc

这样不对?

把数据库里表class改下名,改成classes试一下!

select top5 c_name,c_stu from class where c_stu>30 and c_type is true and c_name like '%二班%' order by c_stu asc,c_type desc