【发布时间】:2014-11-04 20:15:55
【问题描述】:
我正在尝试编写一个同时使用 CASE 和 STRING 的 SQL 查询,但出现错误。 这就是我正在努力的方向。任何帮助是极大的赞赏。 我也尝试添加 STRING 函数,但也不起作用。
SELECT Case
when sn.1_code = 1 then 'Attended -- ' ,
sn.mult_1 ,
, 'and' ,
sn.dict_2 ,
' also acted with ' ,
sn.dict_3 ,
'.' ,
when sn.1_code = 3 then 'left because ' ,
sn.mult_2 ,
'.' ,
when sn.dict_1 = 2 then 'Went home' ,
when sn.dict_1 = 24 then 'Canceled' AS 'Attendance'
FROM db.sn
【问题讨论】:
-
你用的是什么关系型数据库?
-
RDBMS 类型是 Inter systems Cache 系统。但是使用 SQL 来编写查询。
标签: sql string case intersystems-cache