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
what happens if you no create privilege in a database? : Sql dba
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What is union and union all keyword in sql and what are their differences?
what is unique key constraint? : Sql dba
How do I make sql search faster?
what are numeric data types? : Sql dba
How to fix oracle error ora-00942: table or view does not exist
What is the size of partition table?
What is the purpose of my sql?
What are data types in pl sql?
What is the difference between sql and mysql?
What is pls integer?
What is the usage of distinct keyword?
Is mariadb a nosql database?
What is difference between function and trigger?