- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Select last day of current year in MySQL?
In order to get last day of current year, you can use LAST_DAY() from MySQL. The syntax is as follows−
SELECT LAST_DAY(DATE_ADD(CURDATE(), INTERVAL 12-MONTH(CURDATE()) MONTH));
Let us implement the above syntax to know the last day of current year−
mysql> SELECT LAST_DAY(DATE_ADD(CURDATE(), INTERVAL 12-MONTH(CURDATE()) MONTH));
This will produce the following output −
+-------------------------------------------------------------------+ | LAST_DAY(DATE_ADD(CURDATE(), INTERVAL 12-MONTH(CURDATE()) MONTH)) | +-------------------------------------------------------------------+ | 2019-12-31 | +-------------------------------------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- Filter the records of current day, month and year in MySQL?
- How to get last day of the current month in MySQL?
- How to select rows in MySQL that are >= 1 DAY from the current date?
- How to get current day, month and year in Java 8?
- Get current year in MySQL WHERE clause?
- Java Program to adjust LocalDate to last Day of Year with TemporalAdjusters class
- MySQL SELECT last few days?
- MySQL select dates in 30-day range?
- Create date from day, month, year fields in MySQL?
- Python Pandas - Indicate whether the date in DateTimeIndex is the last day of the year
- How to select last row in MySQL?
- Select text after last slash in MySQL?
- Convert day of year to day of month in Java
- Day of the Year in Python
- How can we insert current year automatically in a YEAR type column of MySQL table?

Advertisements