Microsoft SQL Server

article Jun 06, 2017

What You Need to Know about Distinct Windowed Aggregate Calculations

T-SQL supports distinct grouped aggregate calculations like COUNT(DISTINCT ), but as of SQL Server 2017 CTP2, it doesn’t yet support distinct windowed aggregate calculations. There’s an open connect item requesting this feature. In this article, I explain what distinct aggregate calculations are, provide an example for a task that requires such calculations, show the desirable yet missing syntax that would solve the task, and present four supported workarounds.