select * from tbname where coldate between to_date('2003-09-11 07','yyyy-mm-dd hh24') and to_date('2003-09-11 17','yyyy-mm-dd hh24')

解决方案 »

  1.   

    select * from tbname where coldate between to_date('2003-09-11 07','yyyy-mm-dd hh24') and to_date('2003-09-11 17','yyyy-mm-dd hh24')
      

  2.   

    或者用TO_CHAR也行呀:select * from table1 where To_Char(thedate,'yyyy-mm-dd') = '2003-9-23';
      

  3.   

    select * from table1 where to_char(thedate,'yyyy-mm-dd hh24') between '2003-09-11 07' and '2003-09-11 17';
      

  4.   

    楼上:
    你这样用会影响执行效率的,因为对每条记录的thedate都需要用to_char函数运算,这样会更好:
    select * from table1 where thedate = to_date('2003-9-23','yyyy/mm/dd');
      

  5.   

    一天:
    select * from table1 where thedate between to_date('2003-09-11 07:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2003-09-11 17:00:00','yyyy-mm-dd hh24:mi:ss');