Finding Distinct Values Quickly
SQL Performance
MARCH 17, 2020
It comes set to SQL Server 2008 compatibility (level 100), but we will start with a more modern setting of SQL Server 2017 (level 140): ALTER DATABASE StackOverflow2013 SET COMPATIBILITY_LEVEL = 140 ; The tests were performed on my laptop using SQL Server 2019 CU 2. The code may be easier to read and understand than the recursive CTE.
Let's personalize your content