Wednesday, 25 July 2018

MySQL: The finest solution for calculating Age from Date of Birth

In this post, I am sharing the easy and finest way for calculating Age from Date of Birth of MySQL.
As a database architecture, I never suggest to store calculated Age into database because this is ever changing information base on time.
We should store only the Date of Birth into our database system and whenever it requires to show Age, we should calculate Age using Date of Birth.
I have found many complex solutions to calculate Age, but here I am sharing one of the easiest way.
First, create a table with sample data:
Calculating Age for all data:


MySQL Age Calculation

0 comments:

Post a Comment