I want to create table with date_of_birth column and use check() function to only allow adults to be inserted in. All i try causes: "curdate() cannot be used in CHECH() clause"
One of I've tried adding in CREATE TABLE:
CONSTRAINT `adultcheck` CHECK ( TIMESTAMPDIFF(YEAR, date_birth, CURDATE()) >= 21)