Products on-line within 24 hours:
SELECT * FROM goods
WHERE date_sub (Curdate (), INTERVAL 1 day) <= Add_time;
Today's online Products:
SELECT * FROM goods where to_days (add_time) =to_days (now ());
====== Reference =========
MySQL query today, yesterday, 7 days, nearly 30 days, this month data
Today
SELECT * FROM table name where To_days (Time field name) =to_days (now ());
Yesterday
SELECT * from ' table name ' where To_days (now ()) –to_days (Time field name) = 1;
/*datediff (now (), From_unixtime (' Time field name ')) = 1; Time field Storage Type is timestamp */
7 days
SELECT * from ' table name ' where Date_sub (Curdate (), INTERVAL 7 day) <= Date (Time field name);
/*datediff (now (), From_unixtime (' Time field name ')) = 7; Time field Storage Type is timestamp */
Nearly 30 days
SELECT * FROM table name where Date_sub (Curdate (), INTERVAL Day) <= Date (Time field name);
Month
SELECT * FROM table name where Date_format (Time field name, '%y%m ' = Date_format (Curdate (), '%y%m ';
SQL format based on time query