You were really close. You need to alias the subquery.
table1 As b
looses it's scope with the grouping ()
so you need to alias the parenthesized subquery. You could reuse b
- it will only know about the returned columns, but for clarity I chose (...) as c
to disambiguate.
SELECT a.memempid, a.depkey, a.lastname, a.firstname, a.birthdate, a.memrelation
FROM table1 As a
INNER JOIN
(SELECT b.MemEmpID, b.LastName, b.FirstName
FROM table1 As b
GROUP BY b.MemEmpID, b.LastName, b.FirstName
HAVING Count(*) > 1
) as c
ON c.memempid = a.memempid
AND c.lastname = a.lastname
AND c.firstname = a.firstname