Sample Header Ad - 728x90

DISTINCT not reducing two equal values to one

19 votes
1 answer
1223 views
Can anyone explain the below situation, where two seemingly equal values are not reduced by DISTINCT? screenshot showing two values for 'SBS_UCS_DISPATCH' The query above is SELECT DISTINCT name FROM master.sys.dm_os_spinlock_stats where name = 'SBS_UCS_DISPATCH'; The equivalent SELECT name FROM master.sys.dm_os_spinlock_stats where name = 'SBS_UCS_DISPATCH' GROUP BY name; also does the same, and adding HAVING COUNT(1) > 1 does not yield the rows. @@VERSION is *Microsoft SQL Server 2019 (RTM-CU13) (KB5005679) - 15.0.4178.1 (X64) Sep 23 2021 16:47:49 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: )*
Asked by jimbobmcgee (529 rep)
Aug 3, 2023, 02:55 PM
Last activity: Aug 4, 2023, 03:14 PM