t1
id
nombre
t2
id
idt1
t3
id
idt1
t4
id
idt1
com puedo hacer un query
que me de el id y nombre de la t1.... y que tambien me diga cuantas veces existe el t1.id en las demas tablas t2,t3,t4
he intentado con el siguiente query
Código PHP:
SELECT distinct (t1.id), t1.nombre,
COUNT(t2.idt1) cuantost1existenent2,
COUNT(t3.idt1) cuantost1existenent3,
count(t4.idt1) cuantost1existenent4
FROM caso t1
INNER JOIN analistas t2 ON t1.id=t2.idcaso
INNER JOIN diseñadores t3 ON t1.id=t2.idcaso
INNER JOIN diseñadores t4 ON t1.id=t2.idcaso
ORDER BY t1.id
espero que me puedan ayudar. gracias