我想对2列的结果做一个案例.我该怎么做呢?
例如:
SELECT CASE amount=100 AND DATE IS NOT NULL WHEN 0 THEN 'Something' ELSE ''
那样的东西?
select case when amount = 100 and date is not null then 'something' else 'something else' end
这是一个"搜索过的案例表达"(参见MSDN):
CASE WHEN Boolean_expression THEN result_expression [ ...n ] [ ELSE else_result_expression ] END