请教个sql语句

来源:百度知道 编辑:UC知道 时间:2024/05/05 00:38:20
select top 5 c_name,c_stu from class where c_stu>30 and c_type=true and c_name="二班" order by c_stu asc,c_type desc
这个有错误吗

是sql server吗 它里面没有true和false的 还有字符串要写成单引号
可以用1和0代表真和假
select top 5 c_name,c_stu from class where c_stu>30 and c_type=1 and c_name='二班' order by c_stu asc,c_type desc

上面说得很对,
不应该有双引号,true也不清楚是什么意思

不应有双引,应该为单引.