select * from tableA a where to_char(a.日期字段,'yyyy-mm-dd')>='2004-08-01' and to_char(a.日期字段,'yyyy-mm-dd')<='2004-08-08'

解决方案 »

  1.   

    select * from fnd_user a where to_char(a.last_update_date,'yyyy-mm-dd') between '2004-08-01' and '2004-08-08'
      

  2.   

    奇怪了,我表里有数据是的sdate是今天(2004年8月17日)的,为什么我执行以下
    select * from table1 where to_char(sdate,'yyyy-mm-dd')>'2004-6-1'
    却说“未选定行”呢?
      

  3.   

    sdate=(2004年8月17日),
    to_char(sdate,'yyyy-mm-dd')='2004-08-17',字符串比较时,它是小于'2004-6-1'的。
      

  4.   

    select * from tKKK a where to_char(a.日期字段,'yyyy-mm-dd')>='2004-01-01' and to_char(a.日期字段,'yyyy-mm-dd')<='2004-12-08'
      

  5.   

    都让楼上的各位说了,不过你的日期数据在数据库中是以什么方式存储的。
    STRING,LONG,否则可要很烦的转换
      

  6.   

    明白了。
    但不明白的是,为什么ORACLE做的这么不方便呢?应该有直接的日期比较功能才对阿。
      

  7.   

    刚刚学的,还没有验证
    to_Date 比 to_char 效率高
    你也可以用to_date ,格式类似!