Académique Documents
Professionnel Documents
Culture Documents
Sous-interrogations
Interrogation principale :
Sous-interrogation :
?
Quel est le salaire d'Abel ?
SELECT select_list
FROM table
WHERE expr operator
(SELECT select_list
FROM table);
SELECT last_name
FROM employees 11000
WHERE salary >
(SELECT salary
FROM employees
WHERE last_name = 'Abel');
• Sous-interrogation monoligne
Interrogation
principale
Sous- renvoie
interrogation ST_CLERK
• Sous-interrogation multiligne
Interrogation
principale
Sous- renvoie ST_CLERK
interrogation SA_MAN
= Egal à
> Supérieur à
< Inférieur à
<> Différent de
ERROR at line 4:
ORA-01427: single-row subquery returns more than
one row
no rows selected
SELECT emp.last_name
FROM employees emp
WHERE emp.employee_id NOT IN
(SELECT mgr.manager_id
FROM employees mgr);
no rows selected