2017-11-21 3 views
-5

サブクエリ1との違いを説明してください:これらの2つのクエリ

select employee_id,last_name,salary 
from employees 
where salary > (select round(avg(salary),0) 
       from employees 
       ) 
order by salary 

サブクエリ2:

select employee_id,last_name,salary 
from employees 
where salary > all (select round(avg(salary),0) 
        from employees 
        ) 
order by salary 
+0

質問の回答方法https://stackoverflow.com/help/how-to-ask – Eric

答えて

0

を私は、オフ手任意の違いを考えることはできません。サブクエリは、1つの行、つまり平均給与を返します。 allキーワードの有無は、スカラーサブクエリには関係ありません。 salaryNULLの場合、両方の問合せは行を戻しません。

関連する問題