How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 1810 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
- How to get Instagram followers count using JQuery Ajax?
- Simple Example of Bootstrap Lightbox Plugin with demo
- Jquery notification popup box example using toastr JS plugin with demo
- How to fetch this week records in MySql ?
- How to convert line breaks to br in jQuery ?
- Laravel 5 - How to get difference of time in minutes?
- Bootstrap notification popup box example using bootstrap-growl JS plugin with demo
- Laravel 5 Ajax CRUD with Pagination example and demo from scratch