Ver originalSELECT t1.idreceiver FROM (SELECT p.idsender, a.idreceiver FROM principal p INNER JOIN auxiliar a ON p.id = a.id WHERE p.idsender=2)t1 GROUP BY t1.idreceiver