How to calculate age from date of birth column in mysql?By Hardik Savani | June 1, 2016 | | 774 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
- Laravel 5 - Generate Captcha code and Validation example using BotDetect package
- Laravel 5 select with count query with group by example
- Laravel 5 clear cache from route, view, config and all cache data from application
- How to integrate google map using gmaps.js in php example?
- Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin
- Laravel 5.2 API using JWT authentication tutorial from scratch example
- Dynamic Autocomplete search using Bootstrap Typeahead JS Example
- How to clear log file using command in laravel 5 ?