Mysql
 sql >> Database >  >> RDS >> Mysql

mysql Seleziona da Seleziona

Potresti provare a ordinare il set di risultati della query secondaria; qualcosa come:

SELECT
    DATE (a.created_at) AS order_date,
    COUNT(*) AS cnt_order
FROM
    `sales_order_item` AS a
WHERE
    MONTH(a.created_at) = MONTH(now()) - 1
GROUP BY
    order_date
ORDER BY
    cnt_order DESC