few days ago I received an email from those typical chain mails that supposedly brings luck if you send to 20 more people. Clearly, these mails are not based in reality in general and social engineering act as a mechanism for generating waste traffic. Seldom reach more than 2 lines read before deleting them, but in this case caught my attention and piqued my curiosity, and to prove its accuracy with a sql query would be very easy. Clearly this is of no use but to show them how to resolve issues and relationships using date, in this case Oracle, as calculator
extremely expensive.
The mail went something like: "This year is July 5 Friday, May 5 Saturdays and Sundays, this occurs every 823 years, this is called a bag of money, send this to 20 friends ... bla bla bla ". When I read it, I realized that could not be real and to have that schedule as accurate and extensive, since they are dates, it was not possible. To prove it neatly, did a consultation in a manner to generate dates automatically, starting from a quite some time (500000 years back) and adding each time the month was July (07) on Fridays, Saturday and Sunday (6.7 1). If the sum is 15 in that year then there is what reads the mail in question. Then I show the query and the result: select
to_char (dt, 'YYYY') dt, count (1)
from (select sysdate + rownum dt-500 000
from dual connect by rownum
<= 500000)
WHERE to_char (dt, 'MM') = '07 '
and to_char (dt,' d ') in (6,7,1)
group by to_char (dt,' YYYY ') HAVING COUNT
(1)> 14
ORDER BY TO_NUMBER (dt) desc
January 2005 15 February 1994 15 15
March 1988 April 1983 May 1977 15 15
June 1966 July 1960 15 15 15
August 1955 September 1949 October 1938 15 15
November 1932 December 1927 15 15
14 13 1921 15 1910 15 1904 15 15
17 16 1898 15 1892 15 1887 15
18 19 1881 15 20 1870 15
As seen, in 2005 gave for the last time the link above, spent only 6 years to repeat and not 823!.
0 comments:
Post a Comment