Unanswered: HELP WITH FINDING DUPLICATES AND USING A Group By Clause
Why does the GROUP BY CLAUSE below make my query not to work.
Will the following code below work with the GROUP BY CLAUSE?
SELECT D1.ID, D1.BEGPSN AS NEWBEGPSN, D1.DOCTYPE, D1.docsum, COUNT(D1.BEGPSN)
FROM DUPLICATES AS D1
GROUP BY D1.BEGPSN
WHERE EXISTS (Select * From Duplicates D2
where D1.BEGPSN = D2.BEGPSN and d1.ID <> d2.ID)
ORDER BY D1.BEGPSN;