Hi I’m using sql to find out how old someone is. Im doing this using columns Name, Date of birth and todays date.
I used this query below and it works.
SELECT DOB, CURDATE() AS TODAY ,TIMESTAMPDIFF(YEAR,DOB,CURDATE()) AS AGE FROM data
I was just wondering if this is the best way to find a person’s age or is there a better way of writing this or more effiecient way.
Any help would be much appreciated