I wish you all the best in 14 years.
Show the date and the week of the day:
SQL> select to_char (sysdate + level-1, 'yyyy-mm-dd') dt,
To_char (sysdate + level-1, 'aws') weeks from dual connect by level <= 15;
DT WE
------------
2014-01-03 01
2014-01-04 01
2014-01-05 01
2014-01-06 02
2014-01-07 02
2014-01-08 02
2014-01-09 02
2014-01-10 02
2014-01-11 02
2014-01-12 02
2014-01-13 03
2014-01-14 03
2014-01-15 03
2014-01-16 03
2014-01-17 03
15 rows selected.
Display the working day from Monday to Friday and the week of the day:
SQL> select to_char (sysdate + level-1, 'yyyy-mm-dd') dt,
To_char (sysdate + level-1, 'day') day,
To_char (sysdate + level-1, 'aws') weeks from dual where to_char (sysdate + level-1,
'D') not in (7,1) connect by level <= 15;
DT DAY WE
---------------------
Friday 01
Monday 02
Tuesday 02
Wednesday 02
Thursday 02
Friday 02
Monday 03
Tuesday 03
Wednesday 03
Thursday 03
Friday 03
11 rows selected.
Coming year:
Select to_char (sysdate + level, 'yyyymmdd'), to_char (sysdate + level, 'iw') from dual
Connect by level <= (select to_date (to_char (sysdate, 'yyyy') | '000000', 'yyyymmdd')-to_date (to_char (
Sysdate, 'yyyy') | '000000', 'yyyymmdd') + 1 from dual );