24小时内上线商品:
SELECT * FROM goods
WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= add_time;
今天上线商品:
select * from goods where to_days(add_time)=to_days(now());
======参考=========
mysql查询今天、昨天、7天、近30天、本月数据
今天
select * from 表名 where to_days(时间字段名)=to_days(now());
昨天
SELECT * FROM `表名` where TO_DAYS(NOW()) – TO_DAYS(时间字段名) = 1;