N
Nigel Brown
I have a query that identifies duplicate values in a table as follows:
SELECT Fleet.[Project Ref], Count(Fleet.[Project Ref]) AS Dups
FROM Fleet
GROUP BY Fleet.[Project Ref]
HAVING (((Count(Fleet.[Project Ref]))>1));
I would like to be able not to use the Fleet.[Project Ref] results to
create a subset of my table.I have tried the following
SELECT Fleet.*
FROM Fleet AS A INNER JOIN (SELECT Fleet.[Project Ref],
Count(Fleet.[Project Ref]) AS Dups
FROM Fleet
GROUP BY Fleet.[Project Ref]
HAVING ((Count(Fleet.[Project Ref]))>1)) As B
WHERE A.[Project Ref] = B.[Project Ref];
This Is causing a syntax error and highlighting the WHERE part of the
query. WHY?
Regards
Nigel
SELECT Fleet.[Project Ref], Count(Fleet.[Project Ref]) AS Dups
FROM Fleet
GROUP BY Fleet.[Project Ref]
HAVING (((Count(Fleet.[Project Ref]))>1));
I would like to be able not to use the Fleet.[Project Ref] results to
create a subset of my table.I have tried the following
SELECT Fleet.*
FROM Fleet AS A INNER JOIN (SELECT Fleet.[Project Ref],
Count(Fleet.[Project Ref]) AS Dups
FROM Fleet
GROUP BY Fleet.[Project Ref]
HAVING ((Count(Fleet.[Project Ref]))>1)) As B
WHERE A.[Project Ref] = B.[Project Ref];
This Is causing a syntax error and highlighting the WHERE part of the
query. WHY?
Regards
Nigel