select (userinfo其他字段),sexy=case 
                                  when sex=1 then '男'
                                  when sex=0 then '女'
                                  else '怪物'
                                  end
                              from userinfo

解决方案 »

  1.   

    create proc abcd as 
    select *,sexy=case 
                  when sex=1 then '男'
                  when sex=0 then '女'
                  end
    from table1
    在查询分析器怎么怎么查询
      

  2.   

     create proc abcd as 
    select table1.*,sexy=case 
                  when sex=1 then '男'
                  when sex=0 then '女'
                  end
    from table1
    查询分析器里: execute abcd
      

  3.   

    将 varchar 值 '男' 转换为数据类型为 int 的列时发生语法错误。
      

  4.   


    CREATE    proc abcd as 
    update table1 set sex='01' where sex='男'
    GO
    update table1 set sex='02' where sex='女'
    GO
    select * from table1
    GO
    我要实现这样的功能
      

  5.   

    CREATE    proc abcd as
    select userinfo.field1,userinfo.field2,....,sexy=case 
                                      when sex=1 then '男'
                                      when sex=0 then '女'
                                      else '怪物'
                                      end
                                  from userinfo