Pages

OracleEBSpro is purely for knowledge sharing and learning purpose, with the main focus on Oracle E-Business Suite Product and other related Oracle Technologies.

I'm NOT responsible for any damages in whatever form caused by the usage of the content of this blog.

I share my Oracle knowledge through this blog. All my posts in this blog are based on my experience, reading oracle websites, books, forums and other blogs. I invite people to read and suggest ways to improve this blog.


Monday, March 11, 2013

SQL query to check if a year is a leap year


 select &year,
       decode( mod(&year, 4), 0,
          decode( mod(&year, 400), 0, 'Leap year',
             decode( mod(&year, 100), 0, 'Not a Leap year', 'Leap Year')
          ), 'Not a Leap Year'
       ) as leap_year_indicator
from   dual;

No comments:

Post a Comment