BaşlayınÜcretsiz Başlayın

Window functions with aggregations (II)

In the last exercise, you calculated the sum of all orders for each territory. In this exercise, you will calculate the number of orders in each territory.

Bu egzersiz

Intermediate SQL Server

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Count the number of rows in each partition.
  • Partition the table by TerritoryName.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT OrderID, TerritoryName, 
       -- Number of rows per partition
       ___ 
       -- Create the window and partitions
       ___ AS TotalOrders
FROM Orders
Kodu Düzenle ve Çalıştır