--一年中除週六日外的日期
select to_char(ta,'yyyymmdd') from (select to_date('20141231','yyyymmdd') + level ta from dual connect by level<367) where to_char(ta,'d') not in (1,7) and ta <to_date('20160101','yyyymmdd')
--獲取當天是禮拜幾:
select to_char(sysdate,'d') from dual; --禮拜天爲1,禮拜一爲2,類推
--取當前時間的前十分鐘
select sysdate - 10/(60*24) from dual