表中有个date类型的数据
2011-11-29 10:55:41
2011-11-29 14:45:56
2011-11-28 14:45:56怎么查当天的数据,今天是29号,sql怎么写?

解决方案 »

  1.   

    select * from tab where trunc(字段,'dd') = trunc(sysdate,'dd');
      

  2.   

    select * from tab where to_char(字段,'yyyy-mm-dd') = to_char(sysdate,'yyyy-mm-dd');
      

  3.   

    select * from tab where trunc(字段,'dd') = trunc(sysdate,'dd'); 
    select * from tab where 字段>sysdate-0.5;