在sql server 查询分析器里执行它有错误: select sum(case num1=2 then 1 else 0 end) as tt from test 提示错误: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '='.
还是不行,提示错误: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'if'. Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'then'.