我有下面的代码(在oraclebi中)
SELECT CASE
WHEN
Year("Assignment Inactive Date") = 4712
THEN 'THIS'
ELSE 'ELSE'
END
FROM thisTable
这很管用。 THIS
以及 ELSE
相应地显示。但是,如果将其更改为以下内容,则会出现错误: expected CHAR got DATE
```
SELECT CASE
WHEN
Year("Assignment Inactive Date") = 4712
THEN 'THIS'
ELSE "Assignment Inactive Date"
END
FROM thisTable
最后,如果我做了以下操作,所有内容都是空白的。返回行,但所有内容都为空。有什么想法吗?
SELECT CASE
WHEN
Year("Assignment Inactive Date") <> 4712
THEN "Assignment Inactive Date"
END
FROM thisTable
显示a和b
SELECT CASE
WHEN
year("Assignment Inactive Date") = 4712
THEN
'A'
ELSE
'B'
END
只显示a
SELECT CASE
WHEN
year("Assignment Inactive Date") = 4712
THEN
'A'
ELSE
CAST("Assignment Inactive Date" AS VARCHAR(20))
END
暂无答案!
目前还没有任何答案,快来回答吧!