Answers for "mysql find this month total"

SQL
1

this month mysql where

SELECT *
FROM table 
WHERE MONTH(`columnName`) = MONTH(CURRENT_DATE());
Posted by: Guest on December-30-2020
0

mysql count by month

select year(order_date),month(order_date),count(*)
     from sales
     group by year(order_date),month(order_date)
     order by year(order_date),month(order_date);
+------------------+-------------------+-----------+
| year(order_date) | month(order_date) | count(*) |
+------------------+-------------------+-----------+
|             2020 |                 1 |       408 |
|             2020 |                 2 |       320 |
|             2020 |                 3 |       540 |
|              ... |               ... |       ... |
+------------------+-------------------+-----------+
Posted by: Guest on September-02-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language