select count(*) from ( select rownum rnum from all_objects where rownum <= to_date('&1') - to_date('&2')+1 )
where to_char( to_date('&2')+rnum-1, 'DAY' ) not in ( '星期六', '星期日' )
1、注意你数据库的NLS_TERRITORY,你可以需要根据这个替换语句中的'星期六', '星期日' 这部分。
2、注意,在我的例子中我使用了all_objects这个视图,你可以使用任意表,但须确认表要有足够的行数,也就是说日期差1年,表至少要有366行,日期差10年,表至少要有3660行。
温馨提示:答案为网友推荐,仅供参考