当我执行下面的语句的时候,他能正常显示我需要的答案
select dayofyear from (select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
            from dual
            connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd'))
但是我执行下面的语句的时候,他显示的答案只有25天的数据
select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
            from dual
            connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd')
那位大侠给我解释一下,高分请教

解决方案 »

  1.   

    呵呵,结果是一样的,只不过楼主使用的工具限制了查询dual等特殊表的时候的返回行数,我使用plsql仅返回了100条数据select dayofyear from (select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
    from dual
    connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd'))
    minus 
    select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
    from dual
    connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd')select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
    from dual
    connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd')
    minus 
    select dayofyear from (select to_date('2007' || '0101', 'yyyymmdd') + level - 1 as dayofyear
    from dual
    connect by level <= to_char(to_date('2007' || '1231', 'yyyymmdd'),'ddd'))从上面的结果可以看出,返回结果是完全一致的
      

  2.   

    多谢xiaoxiao1984
    我还有一个问题,那您说的限制了查询dual特殊表的返回行数
    这个可以修改他的返回行数吗?
    如果可以修改,那在那可以改那?