How To Get Last 15 Days Data In MySQL?
Hi Friends,
I am going to explain you example of how to get last 15 days data in MySQL?. You will learn MySQL query to get last 15 days data. I would like get last 15 days records in MySQL. This article will give you simple example of SQL query to get last 15 days data.
We will use get search how to select last 15 days from news table using MySQL. You can understand a concept of search how to take last 15 days dates from the current month in MySQL. So, we can illustrate the getting a date 15 days in the past MySQL.
You can see both example of how do I get my last 15 days data in MySQL.
Let's see bellow example:
Table: users
Solution SQL Query:
SELECT
*
FROM `users`
WHERE DATE(created_at) >= (DATE(NOW()) - INTERVAL 15 DAY)
Output:
I hope it will help you...
- How to Increase max_connections in MySQL?
- How to Install the PHP PDO MySQL Extension on Ubuntu 22.04?
- How to Install PHP MySQL on Linux Ubuntu?
- How to Install LEMP Stack Nginx, MySQL, PHP on Ubuntu?
- How to Change MySQL Root User Password Ubuntu?
- PHP 8 MySQL Form Validation Example
- How to Select First Row Only in PHP MySQL?
- How To Backup MySQL Database Using PHP Example