Created
April 17, 2020 15:51
-
-
Save flutesa/0f37e625cd150432e6065b2f1f145ad6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select users.country, sum(orders.order_sum) as total_sum | |
from `DZ1.users` users | |
left join `DZ1.orders` orders | |
on orders.user_id = users.id | |
where users.country = 'Russia' or users.country = 'Brazil' | |
group by users.country | |
order by total_sum desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment