Join four tables using Join

0

In my DB I have a scenario with four tables and I make this query based on them:

SELECT T1.'demo_eleccion_ideleccion' AS 'Ideleccion',
         T1.'idcandidatos' AS 'Idcandidatos',
         T1.'nombre' AS 'Candidatos',
         T1.'numero' AS 'Numero_Tarjeton',
         T1.'tarjeton' AS 'tarjeton'
From demo_candidatos T1
Left Outer Join demo_registro T2 ON T1.idcandidatos = T2.candidato
Left Outer Join demo_voting T3 ON T2.codigo_votante = T3.codigo
where T2.codigo_votante is null

Tables

Based on the scenario, in the table demo_registro (patricio_votante) you already voted the code number 111111; of the two available (111111 and 333333), the problem is that it is only allowing me to make a general vote, I should allow me to vote using the code 333333, which is still available.

Thanks, for the help!

    
asked by c3media 03.02.2018 в 14:50
source

0 answers