TT22

Untitled

Sep 20th, 2017
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.26 KB | None | 0 0
  1. SELECT c.country, c.city, COUNT(o.Order_ID) AS c, SUM (COUNT(o.Order_ID))
  2. OVER(partition BY c.country)  AS s, MAX(COUNT(o.order_ID))
  3. OVER(partition BY c.country)  AS m
  4. FROM Customers c, Orders o
  5. WHERE c.Customer_ID = o.Customer_ID
  6. GROUP BY c.city, c.country;
Advertisement
Add Comment
Please, Sign In to add comment