0

1基本上,如果 Field Blue 是 a ,我想返回 a ,如果不是,我想返回'Y'一个空白。这是我应该怎么做的吗?

Case isnull(Blue, 'N') when Blue = 'Y' then 1 else '' end
4

2 回答 2

1

您的空检查是多余的。您只需要测试'Y'

Case when Blue = 'Y' then '1' else '' end
于 2013-06-21T16:55:33.463 回答
-1

你可以做

Case isnull(Blue, 'N') when 'Y' then '1' else '' end

或者

Case when isnull(Blue, 'N') = 'Y' then '1' else '' end

案例

于 2013-06-21T16:56:48.617 回答