I did not get the concept of "any" and "all". In SQL Server
Both ANY and ALL operators helps to introduce some flexibility in subqueries.
For example, look into this SQL subquery: SELECT emp_name, emp_address from employees WHERE Emp_id = ANY (SELECT Statement……………)
Now, in this query matches Emp_id against any value returned by the subquery.
On the other hand using the ALL operator requires matching all Emp_id(s) returned from the subquery, which is impossible; a single value can not match more than a single one. Inequality operators such as work well here.
For example, look into this SQL subquery: SELECT emp_name, emp_address from employees WHERE Emp_id < ALL (SELECT Statement……………)
0 Comments
Please add nice comments or answer ....