INSERT INTO `test` (`timestamp`) VALUES (1700000000);
select * from test
id timestamp date_time
1 1700000000 2023-11-15 06:13:20
复制代码
状态判断
CREATE TABLE `test` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '测试表id',
`age` int(11) NOT NULL COMMENT '年龄',
`age_v` varchar(2) COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS ((case when (`age` < 12) then '儿童' when (`age` between 12 and 18) then '少年' when (`age` between 19 and 40) then '青年' when (`age` between 41 and 60) then '壮年' else '老年' end)) STORED NOT NULL COMMENT '年龄可视化判断',