I have been trying to find duplicate county names in a state according to StateId
. I have tried to write a SQL query that helps to find duplicate data, but I could not.
SELECT
LOWER(Name) COLLATE SQL_Latin1_General_CP1_CI_AI,
StateId
FROM
County (nolock)
GROUP BY
Name, StateId
HAVING
(COUNT(*) > 1)
I would be very happy if someone could help.