2
Hello, I’m picking up for a query in the database where I need to pick up how many subscribers have registered in a tournament, the problem is that I need to also bring the tournaments that do not have registered yet... I can’t think of the logic behind it, or if the problem is in my own bank.
select
torneio.nome as nome,
count(inscritos_torneio.id) as qtd,
torneio.limiteDuplas as limite,
torneio.descricao as descr
from
torneio, inscritos_torneio
where
torneio.finalizado <= 0 and
torneio.id = inscritos_torneio.idTorneio
group by torneio.id;
You will have to make an Inner Join between the tournament table and entered tournament.
– Diego