How to apply EXTRACT() function with WHERE Clause on the dates stored in MySQL table?



Not Found
404
Not Found

With the help of following MySQL query, we can apply EXTRACT() function with WHERE clause on the dates stored in a table.

mysql> Select StudentName,EXTRACT(Year from dateofreg)AS YEAR from testing WHERE StudentName = 'Gaurav';
+-------------+------+
| StudentName | YEAR |
+-------------+------+
| Gaurav      | 2017 |
+-------------+------+
1 row in set (0.00 sec)
raja
Updated on 27-Feb-2020 06:34:26

Advertisements