📅  最后修改于: 2022-03-11 15:05:07.604000             🧑  作者: Mango
BEGIN
IF (DATEDIFF(CURRENT_DATE(),NEW.birth_date) < 6570) THEN
-- Throw Exception
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Age is less than 18 years!';
END IF; -- A semicolon (delimiter) is missing here
END