Tag : Calculate



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

    How to add multiple markers in google map

    How to add multiple markers in google map

    Open Post

    How to implement lazy loading image with example for your website?

    How to implement lazy loading image with example for your website?

    Open Post

    Bootstrap multiselect dropdown in popup using popupMultiSelect plugin

    Bootstrap multiselect dropdown in popup using popupMultiSelect plugin

    Open Post

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    Open Post

    How to create middleware for XSS protection in laravel 5?

    How to create middleware for XSS protection in laravel 5?

    Open Post

    Multi select autocomplete jquery example with code

    Multi select autocomplete jquery example with code

    Open Post