Ver originalSELECT E.*FROM temple EINNER JOIN (SELECT numde, AVG(salar) salar FROM temple GROUP BY numde) TON E.numde = T.numde AND E.salar > T.salar