Hi,
I have a table similar to:
REF NAME
1 Mike
2 John
3 John
4 Dave
...and I would like to count the number of duplicates using SQL similar to:
SELECT * FROM
(SELECT NAME,COUNT(*)AS C FROM TABLEA GROUP BY NAME) AS TEMP
WHERE C > 1;
The problem I now have is that I would like to link the REF column to other related tables but the count query does not return the REF column. If I include it in the SELECT I get the usual column in GROUP not in SELECT complaint.
Any suggestions?
Mike.
I have a table similar to:
REF NAME
1 Mike
2 John
3 John
4 Dave
...and I would like to count the number of duplicates using SQL similar to:
SELECT * FROM
(SELECT NAME,COUNT(*)AS C FROM TABLEA GROUP BY NAME) AS TEMP
WHERE C > 1;
The problem I now have is that I would like to link the REF column to other related tables but the count query does not return the REF column. If I include it in the SELECT I get the usual column in GROUP not in SELECT complaint.
Any suggestions?
Mike.