first of all naming a column and the table "Students is no good!
, this gave me a duplicate and counted the number of duplicates
SELECT Student, IDNo, Tel3,Tel1, COUNT(*) AS dupes
FROM dbo.Student
GROUP BY Student, IDNo, Tel3,Tel1
HAVING (COUNT(*) > 1)
now if u need to find the duplicates and delete one of them:
/* Delete Duplicate records */
WITH CTE (Student, IDNo, Tel3,Tel1, DuplicateCount)
AS
(
SELECT [Student], IDNo, Tel3,Tel1,
ROW_NUMBER() OVER(PARTITION BY Student, IDNo, Tel3,Tel1 ORDER BY Student) AS DuplicateCount
FROM dbo.Student
)
DELETE
FROM CTE
WHERE DuplicateCount > 1
problem solved...
i may be going on a wild thing here ... and cant seem to understand your problem well... but i dont know..