一个表的字段里面有这样的一个字段,该字段设成int型,0表示是未审阅,1表示未审阅,如何写查询语句,显示这样的效果,对应该字段值为0的记录显示未审阅,为1则显示已审阅,用select语句如何做啊

解决方案 »

  1.   

    select decode(c1,0,'a',1,'b') from table;
      

  2.   

    select decode(c1,0,'未审阅',1,'已审阅') from table;
      

  3.   

    select decode(c1,0,'未审阅',1,'已审阅') from table;
      

  4.   

    同意二楼的方式,依次类推使用同样的方法还可以处理该字段有多种中值的情况 例如:select decode(c1,0,'未审阅',1,'已审阅',2,'未处理',3,'已处理') from table;