أحبائي لي عندكم طلب صغير !!!!!
ممكن أحد يخدمنا ويشرح لنا ما هو Scalar & Correlated Subquery
وما الفرق بينهم ، مع إعطاء أمثلة على الإثنين للتوضيح .

مع تقديري و إحترامي ...
تاريخ المشاركة 30 September 2004 - 09:46 PM
A subquery that returns exactly one column value from one row is referred to as a scalar subquery
SELECT employee_id, last_name
FROM employees e
ORDER BY
SELECT department_name)
FROM departments d
WHERE e.department_id = d.department_id
;(
The Oracle Server performs a correlated subquery when the subquery references a column from a table in the parent query
SELECT last_name, salary, department_id
FROM employees outer
>WHERE salary
(SELECT AVG(salary)
FROM employees
WHERE department_id =outer.department_id
;(
Each time a row from the outer query is processed, the inner query is evaluated
From: Introduction to Oracle9i: SQL