我在tableA表中有个字段columnA是个date型,我想写个SQL语句:
select columnA < sysdate from tableA
预期得到的效果是返回true/false或者1/0之类的。如何实现?谢谢。

解决方案 »

  1.   

    select case when columnA < sysdate then true else false from tableA
      

  2.   

    3KS, 突然忘记了,你一说我就想起了,楼上的SQL还缺少一个end ,完整应该为:select case when columnA < sysdate then true else false end from tableA
      

  3.   

    :),是少了个end ,还有true false要加引号,因为是字符.