olimpicos/consulta.sql
2020-06-20 16:02:35 -04:00

13 lines
538 B
SQL

-- Consulta 1 de la guia
SELECT CONCAT(A.NOMBRE, CONCAT(' ', A.APELLIDO)) AS NOMBRE_ATLETA
FROM PARTICIPAR_PRECOMPETENCIA PP
LEFT JOIN ATLETA A ON (PP.ID_ATLETA = A.ID_ATLETA)
WHERE A.ID_ATLETA NOT IN (
SELECT PC.ID_ATLETA
FROM PARTICIPAR_COMPETENCIA PC
LEFT JOIN COMPETENCIA C ON (C.ID_COMPETENCIA = PC.ID_COMPETENCIA)
LEFT JOIN PRECOMPETENCIA P ON (P.COMPETENCIA = C.ID_COMPETENCIA)
LEFT JOIN PARTICIPAR_PRECOMPETENCIA PP2 ON (PP2.ID_PRECOMPETENCIA = P.ID_PRECOMPETENCIA)
WHERE (PC.ID_ATLETA = PP2.ID_ATLETA)
);