Advertisement
festinko

Untitled

Sep 9th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.25 KB | None | 0 0
  1. SELECT
  2.     YEAR ( created ) AS year,
  3.     MONTH (created ) AS month,
  4.     price,
  5.     count( DISTINCT user_id ) AS usersCount
  6.  
  7. FROM
  8.     orders
  9.  
  10. WHERE
  11. status = 'Processed'
  12.  
  13. GROUP BY
  14.     year,
  15.     month,
  16.     price
  17.  
  18. ORDER BY
  19.     year DESC,
  20.     month DESC,
  21.     price ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement