MySQL Date and Time Exercises: Get the DATE value from a given day
MySQL Date Time: Exercise-10 with Solution
Write a query to get the DATE value from a given day (number in N).
Sample days: 730677
Output: 2000-07-11
Code:
SELECT FROM_DAYS(730677);
Sample Output:
FROM_DAYS(730677) 2000-07-11T04:00:00.000Z
MySQL Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous:Write a query to extract the year from the current date.
Next:Write a query to get the first name and hire date from employees table where hire date between '1987-06-01' and '1987-07-30'.
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