Oracle: Number of days in current month
Oracle Datetime: Exercise-6 with Solution
Write a Oracle SQL statement to get the number of days in current month.
Sample Solution:
Oracle Code:
SELECT CAST (TO_CHAR (LAST_DAY (SYSDATE), 'dd') AS INT) number_of_days FROM DUAL;
Output:
NUMBER_OF_DAYS 1 28
Improve this sample solution and post your code through Disqus.
Previous: Write a Oracle SQL statement to get the first and last day of the current year.
Next: Write a Oracle SQL statement to get number of days between two given dates.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework