我想在oracle中得到一个时间数组,如从2009-10-21到2009-10-30,怎么用sql实现,谢谢各位大侠

解决方案 »

  1.   

    select 日期列名 from 表名  where '2009-10-21'<=日期列<='2009-10-30';
      

  2.   

    where '2009-10-21' <=日期列 <='2009-10-30';  是哪种数据库的语言??
      

  3.   

    select * from test where date between to_date('2009-10-21','yyyy-mm-dd') and 
    to_date('2009-10-30','yyyy-mm-dd')
      

  4.   

    楼上那个也对。。
    我的那个是:
    Sql 语句select 日期列名 from 表名  where '2009-10-21' <=日期列 &&  日期列<='2009-10-30';不可以??
      

  5.   

    SELECT to_date('2009-10-21 00:00:00', 'yyyy-mm-dd hh24:mi:ss') + LEVEL - 1
      FROM dual
    CONNECT BY dummy = dummy AND LEVEL < 11
      

  6.   

    select   *   from   birthday   where   sysdate-to_date(birthday,'yyyymmdd')  between 20091021 and 20091030;
      

  7.   

    开始时间:to_date('2009-10-21 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
    结束时间:to_date('2009-10-30 00:00:00', 'yyyy-mm-dd hh24:mi:ss')需要其它时间,在SQL中可以替换,在存储过程中可用参数替换SELECT to_date('2009-10-21 00:00:00', 'yyyy-mm-dd hh24:mi:ss') + LEVEL - 1
      FROM dual
    CONNECT BY 1 = 1 AND
               LEVEL < to_date('2009-10-30 00:00:00', 'yyyy-mm-dd hh24:mi:ss') -
               to_date('2009-10-21 00:00:00', 'yyyy-mm-dd hh24:mi:ss') + 2;