1

Here is my query:

SELECT
    t2.*
FROM
(
    SELECT
        FullName
    FROM
        pr
    GROUP BY
        FullName
    HAVING
        COUNT(*)>=2
) T1
JOIN
    pr T2 ON T1.FullName = T2.FullName;

I used this answer to build this: SQL Return only duplicate rows.

Although they didn't specify which DBMS they were using, I can assume it was not MS Access since it ran properly for them and not me.

Whenever I try to save this query, it says:

Syntax error in FROM clause

Not sure where this is wrong. I know that access requires some weird brackets during joins but the problem is apparently with one of the FROM statements. Any ideas here?

1 Answer 1

2

I would expect an MS Access query to look like this:

SELECT t2.*
FROM (SELECT FullName
      FROM pr
      GROUP BY FullName
      HAVING COUNT(*) >= 2
     ) AS T1 INNER JOIN
     pr as T2
     ON T1.FullName = T2.FullName;

Note the ass and INNER.

Sign up to request clarification or add additional context in comments.

2 Comments

It was the INNER that did it. Frustrating that Access doesn't give better debugging messages. The extra as went unneeded however.
@Michael . . . The ass might depend on the version of MS Access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.