Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- orderId | creationDate
- 58111 | 2017-01-01 00:00:00
- 58111 | 2017-01-12 00:00:00
- 58232 | 2017-01-31 00:00:00
- 62882 | 2017-02-21 00:00:00
- 90299 | 2017-03-20 00:00:00
- creationMonth | count_orderId
- January | 2
- February | 1
- March | 1
- select count( distinct orderId ), year( creationDate ), month( creationDate )
- from my_table group by year( creationDate ), month( creationDate )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement