sql requête avec NOT EXISTS
Les identifiants des personnes qui possèdent un permis pour toutes les catégories de véhicules (la table CATEGORIES contient au moins un permis pour chaque catégorie) (SQL).
Code:
1 2 3 4 5 6 7 8 9
|
s e l e c t i d P e r s
from PERMIS P
where not e x i s t s ( s e l e c t *
from CATEGORIES A
where not e x i s t s ( s e l e c t *
from CATEGORIES B
where P . idPerm = B. idPerm
and B. catVeh = A. catVeh ) ) |
qui peut m'expliquer cette requête,je ne comprend pas pourquoi on utilise deux fois (not exists).
la clause where P . idPerm = B. idPerm and B. catVeh = A. catVeh,je ne comprend pas cette clause.
Pb n°2
Code:
1 2 3 4 5 6 7
|
s e l e c t i d P e r s
from CARTEGRISES
where not e x i s t s ( s e l e c t * from CATEGORIES, PERMIS
where CATEGORIES . idPerm = PERMIS . idPerm
and CARTEGRISES . i d P e r s = PERMIS . i d P e r s
and CARTEGRISES . catVeh = CATEGORIES . catVeh ) |
je n'ai pas compris cette clause??