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

Aggregate window functions

There are several aggregate window functions available to you. In this exercise, we will look at reviewing multiple aggregates over the same window.

Our window this time will be the entire data set, meaning that our OVER() clause will remain empty.

Bu egzersiz, kursun bir parçasıdır

Time Series Analysis in SQL Server

Kursa Göz Atın

Egzersiz talimatları

  • Fill in the correct aggregate function for each column in the result set.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

SELECT
	ir.IncidentDate,
	ir.NumberOfIncidents,
    -- Fill in the correct aggregate functions
    -- You do not need to fill in the OVER clause
	___(ir.NumberOfIncidents) OVER () AS SumOfIncidents,
	___(ir.NumberOfIncidents) OVER () AS LowestNumberOfIncidents,
	___(ir.NumberOfIncidents) OVER () AS HighestNumberOfIncidents,
	___(ir.NumberOfIncidents) OVER () AS CountOfIncidents
FROM dbo.IncidentRollup ir
WHERE
	ir.IncidentDate BETWEEN '2019-07-01' AND '2019-07-31'
AND ir.IncidentTypeID = 3;
Kodu Düzenle ve Çalıştır