How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 5853 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
- Jquery ajax request example
- How to disable model timestamps in Laravel 5.3?
- How to remove empty values from array in PHP?
- Laravel 5.3 - Call to undefined method Illuminate\Database\Query\Builder::lists() Solved
- How to change date format in jquery using moment JS ?
- How to get size of directory in MB Laravel 5?
- Laravel 5.3 - Create Bootstrap Contact US Form using Form Request
- How to enable rewrite mode for apache in ubuntu?