more useful options | |
PerlMonks |
Re^2: How do you remember the number of days in each month?by chacham (Prior) |
on Sep 16, 2014 at 16:08 UTC ( [id://1100790]=note: print w/replies, xml ) | Need Help?? |
About the same in Oracle
After the update in the parent, i realized this too could be shortened: But, if we can cheat and specify the year, using the ANSI date literal is slightly shorter:
In a race with the parent to find the shortest SQL. :) So far we went with a literal data (which locks it to 2014), but he outdid me by removing the '20' from the date. Touché! Though, not to be outdone, we'll find something shorter (as of update 4) and even go back to working for every year:
Saved 3 characters. :) If we can start from December, we'll save 8 more characters (for a total of 11): SELECT TO_CHAR(TO_DATE(LEVEL,'MM')-1,'DD')FROM Dual CONNECT BY LEVEL<13;
In Section
Past Polls
|
|