表里有个int型字段 存的是1,2,3  1代表过期 2代表停止 3代表正常 现在我查询这张表的信息 我不想查询出1,2,3 我想是他的实际状态 这样客户好看懂些 怎么办 求救!!!!

解决方案 »

  1.   

    select case field when 1 then '过期' when 1 then '停止' when 1 then '正常' end  as field  from table
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070212http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    select case field when 1 then '过期' when 2 then '停止' when 3 then '正常' end  as field  from table
      

  3.   

    case [字段] when 1 then '过期' when 2 then '停止' when 3 then '正常' end as [字段]