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

Creating running totals

You usually don't have to use ORDER BY when using aggregations, but if you want to create running totals, you should arrange your rows! In this exercise, you will create a running total of OrderPrice.

Bu egzersiz

Intermediate SQL Server

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

Egzersiz talimatları

Create the window, partition by TerritoryName and order by OrderDate to calculate a running total of OrderPrice.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT TerritoryName, OrderDate, 
       -- Create a running total
       ___ 
       -- Create the partitions and arrange the rows
       ___(___ TerritoryName ___ OrderDate) AS TerritoryTotal	  
FROM Orders
Kodu Düzenle ve Çalıştır