|
Re: Sundays with date [message #611639 is a reply to message #611636] |
Sat, 05 April 2014 03:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Sundays in 2014 (so far):
SQL> with dates as
2 (select trunc(sysdate, 'yyyy') + level - 1 col
3 from dual
4 connect by level <= sysdate - trunc(sysdate, 'yyyy')
5 )
6 select col, to_char(col, 'day') day
7 from dates
8 where to_char(col, 'd') = 7;
COL DAY
---------- ---------
05.01.2014 sunday
12.01.2014 sunday
19.01.2014 sunday
26.01.2014 sunday
02.02.2014 sunday
09.02.2014 sunday
16.02.2014 sunday
23.02.2014 sunday
02.03.2014 sunday
09.03.2014 sunday
16.03.2014 sunday
23.03.2014 sunday
30.03.2014 sunday
13 rows selected.
SQL>
Note that you might need to modify this line:if Sundays aren't day number 7 in your country.
|
|
|