Answer Posted / bis
A query which uses values from the outer query is called as a correlated sub query. The subquery is executed once and uses the results for all the evaluations in the outer query.
Here, the sub query references the employee_id in outer query. The value of the employee_id changes by row of the outer query, so the database must rerun the subquery for each row comparison. The outer query knows nothing about the inner query except its results.
select employee_id, appraisal_id, appraisal_amount From employee
where
appraisal_amount < (select max(appraisal_amount)
from employee e
where employee_id = e. employee_id);
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How do I save the results of sql query in a file?
What is oracle and pl sql?
what is blob? : Sql dba
How do you remove duplicates without using distinct in sql?
What is not in sql?
Which kind of parameters cannot have a default value in pl sql?
What is a pdo connection?
Is hadoop a nosql?
What are different sql data types?
How to revise and re-run the last sql command?
What is server name sql?
how do you know if your mysql server is alive? : Sql dba
what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba
how do you know the version of your mysql server? : Sql dba
What is linq to sql?