How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 1052 Viewer | Category : MySql
Share this post:
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
- Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL
- How to generate random unique string in Laravel 5?
- Jquery ajax request example
- How to check uploaded file is empty or not in Laravel 5.3?
- Angular $scope.form value undefined on submit in ionic framework.
- Simple accordion example code with demo using jquery ui
- Laravel 5 Pagination example
- Mysql procedure with pagination in laravel 5?