select * from  table where  trunc(bu_date)>=TO_DATE('2004-11-10','YYYY-MM-DD') and trunc(bu_date)<=TO_DATE('2004-11-10','YYYY-MM-DD') order by bu_date desc;orselect * from  table where  bu_date>=TO_DATE('2004-11-10','YYYY-MM-DD') and bu_date<=TO_DATE('2004-11-11','YYYY-MM-DD') order by bu_date desc;

解决方案 »

  1.   

    select * from  table where  bu_date>=TO_DATE('2004-11-10','YYYY-MM-DD') and bu_date<=TO_DATE('2004-11-10 23:59:59','YYYY-MM-DD') order by bu_date desc;因为日期是带有时分秒的.
      

  2.   

    如果你的字段是date型的。
    那么如下即可,
    SQL> select * from aa;MYDATE
    ---------
    11-NOV-04
    11-NOV-04SQL> select * from aa where to_char(mydate,'yyyy-mm-dd')='2004-11-11';MYDATE
    ---------
    11-NOV-04
    11-NOV-04SQL> desc aa
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------
     MYDATE                                             DATE
      

  3.   

    如果只去一天纪录可以用like
    select * from  table where  bu_date like TO_DATE('2004-11-10','YYYY-MM-DD') order by bu_date desc";
    或者转为字符串比较
    select * from  table where  to_char(bu_date,'yyyy-mm-dd') = '2004-11-10' order by bu_date desc";
      

  4.   

    你想查出某一天的记录吗?
    select * from  table where  trunc(bu_date,'dd')>=TO_DATE('2004-11-10','YYYY-MM-DD') and trunc(bu_date,'dd')<=TO_DATE('2004-11-10','YYYY-MM-DD') order by bu_date desc";trunc的作用是把日期类型的精确到天,不计后面的时分秒,当然,精确度可由你自己决定.
      

  5.   

    这样也行
    select * from  table where  to_char(bu_date,'yyyy-mm-dd')>='2004-11-10' and to_char(bu_date,'yyyy-mm-dd')<='2004-11-10' order by bu_date desc