How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 917 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
- CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch
- How to add Delete cascade to existing column in Laravel 5, without remove column?
- How to implement infinite ajax scroll pagination in Laravel 5?
- Laravel 5 and Vue JS CRUD with Pagination example and demo from scratch
- Laravel - How to make subquery in select statement?
- PHP: How to count files in folder?
- How to create and check custom header with middleware for REST API in Laravel 5 ?
- Laravel 5 Google OAuth authentication using Socialite Package