I need to create a table with a column named age to calculate the age from the birth of date and I am using the following code:
CREATE TABLE AgeTable
(
ID INT(3),
DOB Date,
Age int(100) AS (TIMESTAMPDIFF (YEAR, DOB, CURDATE()))
);
I get the following ERROR!!!
Error Code: 3763. Expression of generated column 'Age' contains a disallowed function: curdate.
Any help please, btw I am using MySQL.
Thanks in advance.