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
Table of contents Preface Background Implementati...
Table of contents 1. Introduction 2. GitHub 3. Ba...
Table of contents introduction Install Homebrew I...
This article example shares the specific code of ...
Table of contents 1. Current situation 2. Create ...
Table of contents MySQL query tree structure 1. A...
I installed a virtual machine a long time ago, an...
A mature database architecture is not designed wi...
Table of contents Preface start Basic layout Data...
Table of contents 1. Implement the $(".box1&...
Table of contents Storage Engine Storage engines ...
To improve processing power and concurrency, Web ...
Strictly speaking, nginx does not have a health c...
1. Summary of location usage Location can locate ...
concept If the index contains all the data that m...