Find a SQL query statement
Table Name: Archives
Field: Writer pubdate
Data format: 31,384,858,337
Writer= Author name
Pubdate= Submission Time
I need to list all the data that the author submitted for Zhang San that day, and ask for SQL query statements.
Note: Because the timestamp is purely numeric, consider whether it is necessary to format the timestamp as:%y-%m-%d%h:%i.
Share to:
------Solution--------------------
SELECT * FROM archives where Date_format (From_unixtime (pubdate), '%y-%m-%d ') =curdate () and Writer= ' Zhang San ';
------Solution--------------------
SELECT * FROM archives where writer= ' Zhang San ' and pubdate between Unix_timestamp (date) and Unix_timestamp (date (Adddate (No W (), 1)));
------Solution--------------------
SELECT * FROM archives where writer= ' Zhang San ' and pubdate between Unix_timestamp (date (now ())) and Unix_timestamp (Date (Adddate ( Now (), 1));