Answer: The Subquery is one which Produces output based on the inner query values.
Whereas, Co-related subquery is one which the output based on the values of outer query.
E-g
SELECT e.EmployeeID
FROM HumanManangement.Employee e
WHERE e.ContactID IN
(
SELECT c.ContactID
FROM Employee_Person.Contact c
WHERE MONTH(c.ModifiedDate) = MONTH(e.ModifiedDate)
)
Asked In: Many Interviews |
Alert Moderator