How to make a selection for the current month, current week, last week and last month?
In the orders table I have entered the data in the date column - 1413118559.8952 (for example), there are many such records. :)
Running around the Internet, I made a request:
Select SUM(price) FROM orders WHERE MONTH(`date`) = MONTH(NOW()); then this:
Select SUM(price) FROM orders WHERE date > LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND date < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY); Requests work, but give out zero result, I need the help.
In what form the data is recorded in the database in the "date" column is unknown, since the code is encrypted, and I need to make a count of income. :)