cruim Asked:2020-01-27 23:02:41 +0800 CST2020-01-27 23:02:41 +0800 CST 2020-01-27 23:02:41 +0800 CST DAYNAME(CURDATE()) 772 您需要添加一列,在其中添加一行时,将写入星期几的名称。我尝试了几种类型并设置了默认值DAYNAME(CURDATE()),但没有用。大约随着时间的推移在这里实施 `add_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP mysql 1 个回答 Voted Best Answer Deonis 2020-01-27T23:28:47+08:002020-01-27T23:28:47+08:00 尝试触发: CREATE TRIGGER `trigger_name` BEFORE INSERT ON `table_name` FOR EACH ROW IF NEW.`field_name` IS NULL THEN SET NEW.`field_name` = DAYNAME(CURDATE()); END IF;
尝试触发: