I tried this query recently
SELECT Id, Name FROM AppMenuItem WHERE Id IN (SELECT SetupEntityId From SetupEntityAccess WHERE Parent.ProfileId =: id) ORDER BY Label
and got this error
The selected field 'SetupEntityId' in the subquery and the left operand field in the where expression in the outer query 'Id' should point to the same object type
I'm trying to do this for a profile such as the id would be the passed in id of the profile