sql case when 老是语法报错,请问语法哪错了?SELECT zhu.mingzi,zhu.riqi,zhu.liucheng,zhu.xinghao,zhu.shuliang,casewhen [liucheng] = '点装' then '1'when [liucheng] = '装脚' then '2'when [liucheng] = '只装' then '3'when [liucheng] = '
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/31 02:38:03
sql case when 老是语法报错,请问语法哪错了?SELECT zhu.mingzi,zhu.riqi,zhu.liucheng,zhu.xinghao,zhu.shuliang,casewhen [liucheng] = '点装' then '1'when [liucheng] = '装脚' then '2'when [liucheng] = '只装' then '3'when [liucheng] = '
sql case when 老是语法报错,请问语法哪错了?
SELECT zhu.mingzi,zhu.riqi,zhu.liucheng,zhu.xinghao,zhu.shuliang,
case
when [liucheng] = '点装' then '1'
when [liucheng] = '装脚' then '2'
when [liucheng] = '只装' then '3'
when [liucheng] = '点胶' then '4'
when [liucheng] = '切腿' then '5'
when [liucheng] = '电测' then '6'
when [liucheng] = '全检' then '7'
else '8' end AS dj
[shuliang]*[danjia] AS zongjia
FROM danjia,zhu;
sql case when 老是语法报错,请问语法哪错了?SELECT zhu.mingzi,zhu.riqi,zhu.liucheng,zhu.xinghao,zhu.shuliang,casewhen [liucheng] = '点装' then '1'when [liucheng] = '装脚' then '2'when [liucheng] = '只装' then '3'when [liucheng] = '
access 没有case 语句的,你可以用iif 来实现
SELECT zhu.mingzi, zhu.riqi, zhu.liucheng, zhu.xinghao, zhu.shuliang,
iif(liucheng = '点装',1,
iif(liucheng = '装脚',2,
iif(liucheng = '只装',3,
iif(liucheng = '只装',4,
iif(liucheng = '只装',5,
iif(liucheng = '只装',6,
iif(liucheng = '只装',7,8)
)))))) as dj
[shuliang]*[danjia] AS zongjia
FROM danjia, zhu