I am pretty sure there are rows with duplicate column values in the table:
SELECT TenancyReferralKey, FromDate, ToDate, ToDate_Value, ReferralID, ReferralFor, ReferralStatus FROM dm.Dim_TenancyReferral WHERE ReferralID IN ('1138', '1940', '1946') ORDER BY ReferralID And I am trying to count the number of rows with the duplicated ReferralID:
SELECT TenancyReferralKey, FromDate, ToDate, ToDate_Value, ReferralID, ReferralFor, ReferralStatus, COUNT(*) [Occurrences] FROM dm.Dim_TenancyReferral GROUP BY TenancyReferralKey, FromDate, ToDate, ToDate_Value, ReferralID, ReferralFor, ReferralStatus HAVING COUNT(*) > 1 But getting empty result set.
Thanks for your help.

