I am trying to find duplicate entries in the table but if I use Code
only in the script then it will give me the duplicate entries in the table.
But I want to get all the information from the table including duplicate code
.
Can someone guide me where I am doing wrong?
This results in 2 entries:
SELECT code, COUNT(code)
FROM CodeDefinition
WHERE codingSystem = '2.16' AND code='835002601'
GROUP BY code
HAVING COUNT(code) > 1
But when I tried the below script, it returns nothing.
SELECT code, COUNT(code), description, shortdescription
FROM CodeDefinition
WHERE codingSystem = '2.16' AND code='835002601'
GROUP BY code, description, shortdescription
HAVING COUNT(code) > 1