select count(*)
2 from ( select rownum-1 rnum
3 from all_objects
4 where rownum <= to_date('&1') - to_date('&2')+1 )
5 where to_char( to_date('&2')+rnum-1, 'DY' )
not in ( 'SAT', 'SUN' )
Why are we adding -1 to rownum, and then adding one below
where rownum <= to_date('&1') - to_date('&2')+1 ), and then
subtracting -1 again below
where to_char( to_date('&2')+rnum-1, 'DY' )
not in ( 'SAT', 'SUN' )
Thank you