根据当前时间来显示活动事件,越靠近当前时间的显示在最前面
1.当前时间为 2015-11-25,则显示顺序
2015-11-25, 2015-11-26, 2015-12-27, 2015-01-20, 2014-11-24
2.当前时间为 2015-12-01,则显示顺序
2015-12-27, 2015-11-25, 2015-11-26, 2015-01-20, 2014-11-24
3.当前时间为 2015-12-30,则显示顺序
2015-12-27, 2015-11-25, 2015-11-26, 2015-01-20, 2014-11-24
这个where语句要怎么写
这年头伸手党真多,拿去玩吧
SELECT * from 表名 where event_start_date<CURDATE() order by event_start_date desc;
2.当前时间为 2015-12-01,则显示顺序
2015-12-27, 2015-11-25, 2015-11-26, 2015-01-20, 2014-11-24
2015-12-27 距 2015-12-01 26天
2015-11-25 距 2015-12-01 5天
为何 2015-12-27 要排在前面?
不是与 越靠近当前时间的显示在最前面 的条件相佐吗
2.当前时间为 2015-12-01,则显示顺序
2015-12-27, 2015-11-25, 2015-11-26, 2015-01-20, 2014-11-24
2015-12-27 距 2015-12-01 26天
2015-11-25 距 2015-12-01 5天
为何 2015-12-27 要排在前面?
不是与 越靠近当前时间的显示在最前面 的条件相佐吗
这年头伸手党真多,拿去玩吧
SELECT * from 表名 where event_start_date<CURDATE() order by event_start_date desc;
这年头伸手党真多,拿去玩吧
SELECT * from 表名 where event_start_date<CURDATE() order by event_start_date desc;
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号