I create an SQL statement to check duplicated records in a table. If the table does not have duplicated records, the count should return zero. The actual result is the count return empty
SELECT COUNT(1) MY_ID_dup_count
FROM mytable
GROUP BY MY_ID
HAVING COUNT(1) >1
Expect Result: MY_ID_dup_count 0
Actual Result: MY_ID_dup_count
MS SQL version: Microsoft SQL Server 2017 - 14.0.3381.3 (X64)