The field stores the timestamp. how to obtain all records of the day? how to write SQL statements? solution ------------------ SQLcodeSELECT * fromtablewhereDATE (FROM_UNIXTIME (time )) DATE (NOW (); ------ solution ---------------- The Field stores the timestamp.
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 ()