Ver originalSELECT tp.name, tp.id, *SUM(st1.`like`) as likes, SUM(st1.dislike) as dislikes, SUM(st1.visits)* as visitsFROM tablaPrincipal tpJOIN subTabla2 st2 *ON tp.id = st2.tpidJOIN subtabla st1 ON st2.id = st1.st2idGROUP BY tp.id, tp.name