1
Try:
SELECT modalidades.* FROM modalidades LEFT JOIN inscricoes ON (modalidades.id = inscricoes.id_modalidade)
WHERE inscricoes.id_modalidade IS NULL;
If you need the name of the championship:
SELECT modalidades.*, campeonato.*
FROM modalidades INNER JOIN campeonato ON (modalidades.id_campeonato = campeonato.id)
LEFT JOIN inscricoes ON (modalidades.id = inscricoes.id_modalidade)
WHERE inscricoes.id_modalidade IS NULL;
===========
Add at the end of the clause ON
of inscricoes
:
AND inscricoes.id_pessoa = id_da_pessoa_desejada
Welcome to Stack Overflow! Your question seems to have some problems and your experience here in Stack Overflow may not be the best because of this. We want you to do well here and get what you want, but for that we need you to do your part. Here are some guidelines that will help you: Stack Overflow Survival Guide in English.
– Maniero