MySQL 函数

一、日期函数

参考:mysql 日期操作 增减天数、时间转换、时间戳

1)select count(*) from user_info t where t.created_time > DATE_SUB(now(),INTERVAL 100 DAY);  -- 查出100天之前创建的记录数

2)select unix_timestamp();  -- 查出当前距格林威治时间秒数

二、

select uuid();

select floor(rand() * 1000);  -- 1000 以内随机整数

原文地址:https://www.cnblogs.com/zhiqsyr/p/6050185.html