As shown below: Yesterday: UNIX_TIMESTAMP(CAST(SYSDATE() AS DATE) - INTERVAL 1 DAY) Today: UNIX_TIMESTAMP(CAST(SYSDATE() AS DATE)) To query today's records, you only need to have a timestamp whose creation time is greater than or equal to 0:00 today (only when there is no creation time greater than today). Yesterday's records are greater than or equal to 0:00 yesterday and less than 0:00 today. The above example of how to get the 0:00 timestamp of today and yesterday in MySQL is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to use ss command instead of netstat in Linux operation and maintenance
>>: Nginx's practical method for solving cross-domain problems
Everything needs a foundation. To build a house, ...
Table of contents background analyze Data simulat...
Since I installed the official version of IE8.0, ...
Today I saw a little trick for HTML text escaping ...
In actual projects, the database needs to be back...
Preface Forgotten passwords are a problem we ofte...
Achieve results First use HTML to build a basic f...
Table of contents Dirty pages (memory pages) Why ...
MySQL 8 new features: My personal opinion on MySQ...
Table of contents Overview Require URL of the app...
Table of contents Overview The history of CPU-bou...
Pixel Resolution What we usually call monitor res...
After configuring VIP, the error message that app...
The pitfalls 1. Many tutorials on the Internet wr...
This article shares the specific code of Vue usin...