How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 4235 Viewer | Category : MySql
Sometimes, we require to get age from birthdate using mysql select query, we can do it in programming like php,.net and etc framework but if we can do it using mysql query. In bellow example mysql query you can learn how to get age from date field. We can get age value from using mysql DATEDIFF(). So, let's see bellow query.
(DATEDIFF(CURRENT_DATE, STR_TO_DATE(born_date, '%Y-%m-%d'))/365) as age
- How to get keys name from array using array helper in PHP Laravel ?
- Laravel tokenmismatchexception in verifycsrftoken.php - Solved
- Mediafire PHP file uploading and get link example
- Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch
- Fixed - MassAssignmentException in model.php laravel 5?
- How to check if record exists or not in Laravel 5?
- Laravel 5.5 CRUD Example from scratch
- Laravel 5 - where condition with two columns example code