摘要: 1、当前日期 select DATE_SUB(curdate(),INTERVAL 0 DAY) ; 2、明天日期 select DATE_SUB(curdate(),INTERVAL -1 DAY) ; 3、昨天日期 select DATE_SUB(curdate(),INTERVAL 1 DAY 阅读全文
posted @ 2021-05-12 11:40 2538 阅读(105) 评论(0) 推荐(0)
摘要: 一、MySQL 获得当前日期时间 函数 1.1 获得当前日期 + 时间(date + time) 函数:now() mysql> select now();+———————+| now() |+———————+| 2008-08-08 22:20:46 |+———————+ 除了 now() 函数能 阅读全文
posted @ 2021-05-12 11:31 2538 阅读(78) 评论(0) 推荐(0)
摘要: //// 时间间隔一天的数量 select count(userid) from t_users where ((UNIX_TIMESTAMP(login_time) - UNIX_TIMESTAMP(create_time)) div 86400 )=1 //// 时间间隔一天的数量,实际到秒。 阅读全文
posted @ 2021-05-12 11:29 2538 阅读(646) 评论(0) 推荐(0)