Tag : DATEDIFF()



How to calculate age from date of birth column in 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. <strong>Example:</strong> <pre> SELECT id, (DATEDIFF(CURRENT_DATE, STR_TO_DATE(born_date, '%Y-%m-%d'))/365) as age FROM `users` </pre>

By Hardik Savani | June 1, 2016 | | 3467 Viewer | Category : MySql
READ MORE

    Laravel 5 create word document file using phpoffice/phpword package

    Laravel 5 create word document file using phpoffice/phpword package

    Open Post

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Open Post

    Laravel 5 create custom artisan command with example

    Laravel 5 create custom artisan command with example

    Open Post

    AngularJS - update bind ng-model input value from Jquery Code

    AngularJS - update bind ng-model input value from Jquery Code

    Open Post

    AngularJS - How to render HTML value in ng-repeat ?

    AngularJS - How to render HTML value in ng-repeat ?

    Open Post

    How to add custom jquery validation for image file upload in summernote ?

    How to add custom jquery validation for image file upload in summernote ?

    Open Post