Good evening,
I'm trying to do a join to 5 tables to get me the information so that it is not returning any data to me.
Code
SELECT * FROM estabelecimentos
INNER JOIN estabelecimentos_anexos
ON estabelecimentos_anexos.id_mae = estabelecimentos.id
INNER JOIN (SELECT COUNT(*) AS id FROM avaliacoes)
ON avaliacoes.estabelecimento_id = estabelecimentos.id
INNER JOIN (SELECT COUNT(*) AS id FROM estabelecimentos_anexos)
ON estabelecimentos_anexos.id_mae = estabelecimentos.id
INNER JOIN (SELECT COUNT(*) AS id_post FROM posts)
ON posts.estabelecimento_id = estabelecimentos.id
INNER JOIN (SELECT ROUND((SUM(pontos) / COUNT(*)), 1) FROM avaliacoes)
ON avaliacoes.estabelecimento_id = estabelecimentos.id
WHERE estabelecimentos.activo = 1