select a= (case a when '1' then '不通过'
                     when '0' then '通过' 
                     when '9' then '未定'
           end)
    from table1

解决方案 »

  1.   

    视图可以支持CASE呀,你把它改成
    select a= case a when '1' then '不通过'
                         when '0' then '通过' 
                         when '9' then '未定' end
        from table1
    就可以了
      

  2.   

    我加了END还是报错“查询设计器不支持 CASE SQL 构造“,难道不能在查询设计器中添加,晕啊!
      

  3.   


    select case a when '1' then '不通过'
                         when '0' then '通过' 
                         when '9' then '未定' end as 'a'
        from table1
    就可以了
      

  4.   

    我也遇到这样的问题了,我感觉是SQL Server企业管理器的BUG,case运行没有问题但是就是提示不支持case构造SQL,我在Visual Studio .NET 2003的环境中连接SQL Sevrer以后,再设计试图什么问题都没有!!!