The field stores the timestamp. how does one obtain all records of the current day? How does one write the SQL statement on the current day? SQLcodeSELECT * fromtablewhereDATE (FROM_UNIXTIME (time )) = DATE (NOW ();, SQLcodeSELECT * FROMtableW field stores the timestamp, how to obtain all records of the day, and how to write SQL statements
The field stores the timestamp. how does one obtain all records of the current day? How does one write SQL statements?
------ Solution --------------------
SQL code
SELECT * from table where DATE (FROM_UNIXTIME (time) = DATE (NOW ());
------ Solution --------------------
SQL code
SELECT * FROM table where date (FROM_UNIXTIME (time) = CURDATE ();
------ Solution --------------------
SQL code
SELECT * FROM table WHERE FROM_UNIXTIME (TIME, '% Y-% m-% d') = CURDATE ();
------ Solution --------------------
None of the above statements are recommended:
Select * from 'table' where 'time'> = curdate ()