各位牛人,求救sql条件排序问题 一个X表中,有id,A,date三个字段其中A字段不是每条记录都有信息按照下面条件进行选择,用一条sql语句1选择所有记录2将A为非NULL的记录按照A的升序排在前面3将A为NULL的记录按照date降序排列,跟在之前的排序后面。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from x order by case when a is not null then a else 1 end,case when a is null then date else 0 end select * from X order by (case when A not IS NULL then A else date) select * from table1 order by case when a is not null then 1 else 2 end asc,a asc,date desc else 1和else 0是什么意思? when 。。條件 成立 then 顯示 else --不成 立顯示 end 1和0有什么区别呢?不好意思哈,我初学sql不久,case很少用,麻烦您了。 select * from X order by (case when A is not null then A end),(case when A is null then date end) desc 三张表联合查询,并过滤重复数据的问题,请教【谢谢】 提示语法错误,但是这个语句在access中通过 知道单价和数量,怎么得到总价呢,在线等待! 为什么不允许访问系统提供的Northwind.sdf 数据库 调用数据更新存储过程的参数声明的问题 请问CONVERT()是什么函数啊!!! 如何做好学校机房管理员 谁能给我解释一下视图? 一个较简单的问题 请教数据插入的问题? win7下安装SQL问题 求助 文本型数字排序问题
else 1和else 0是什么意思?
when 。。條件 成立 then 顯示 else --不成 立顯示 end