alguém poderia me ajudar a compreende a logica das 2 consultas abiaxo?
I)
SELECT B.NOME, COUNT(*)
FROM FUNCIONARIO AS A,
PROJETO AS B,
ALOCADO AS C
WHERE C.PFUNCIONARIO = A.IDFUNCIONARIO AND
C.PPROJETO = B.IDPROJETO AND
DEPENDENTES > 3 AND
B.IDPROJETO IN
(SELECT PPROJETO
FROM ALOCADO
GROUP BY PPROJETO
HAVING COUNT(*) > 4)
GROUP BY B.NOME;
II)
SELECT IDFUNCIONARIO, NOME
FROM FUNCIONARIO
WHERE NOT EXISTS
( (SELECT IDPROJETO
FROM PROJETO
WHERE PRIORIDADE = 2 AND IDPROJETO NOT IN
(
SELECT PPROJETO
FROM ALOCADO
WHERE PFUNCIONARIO = IDFUNCIONARIO
)
)
);
Question
GRAO777
alguém poderia me ajudar a compreende a logica das 2 consultas abiaxo?
I)
II)vlw
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.