select l.id, l.surname, l.fname, LAST_DAY(ADD_MONTHS('02.03.2013', -2)) + level,
TO_CHAR(T.fdate,'DD.MM.YYYY') FDATE from pers_log t, pers_list l
where t.id=l.id and t.id='1316'
CONNECT BY NOCYCLE level <= LAST_DAY(ADD_MONTHS('02.09.2013', -1)) - LAST_DAY(ADD_MONTHS('02.09.2013', -2))
我在表格中写了一个查询。但进入了无限循环。尽管等待了很长时间并没有返回结果。我不明白我错在哪里......(请注意月份中的天数)
21 aaaa bbbbb 01.08.2013 (note:pers_log fdate is not null)
2 aaaa bbbbb 02.08.2013 (note:pers_log fdate is not null)
23 aaaa bbbbb 03.08.2013 (note:pers_log fdate is not null)
null null null 04.08.2013
55 aaaa bbbbb 05.08.2013 (note:pers_log fdate is not null)
null null null 06.08.2013
....
null null null 27.08.2013
28 aaaa bbbbb 28.08.2013 (note:pers_log fdate is not null)
null null null 29.08.2013
60 aaaa bbbbb 30.08.2013 (note:pers_log fdate is not null)
51 aaaa bbbbb 31.08.2013 (note:pers_log fdate is not null)
以下毕竟不是问题,但是我找不到像上面组织的查询那样进入无限循环的原因。
select l.id, l.surname, l.fname
TO_CHAR(T.fdate,'DD.MM.YYYY') FDATE from pers_log t, pers_list l
and to_char(t.FDATE, 'YYYY')='2013' and to_char(t.FDATE, 'MM')='08' and t.id='1316'
order by FDATE asc
21 aaaa bbbbb 01.08.2013
2 aaaa bbbbb 02.08.2013
23 aaaa bbbbb 03.08.2013
55 aaaa bbbbb 05.08.2013
28 aaaa bbbbb 28.08.2013
60 aaaa bbbbb 30.08.2013
51 aaaa bbbbb 31.08.2013
我上面写的查询的结果是什么,下面的查询返回错误,原因和结果,但是