![]() ![]() Replace the existing query with the following code: SELECT od.SalesOrderID, od.ProductID, od.OrderQty Conceptually, the inner query runs once for each row returned by the outer query (which is why correlated subqueries are sometimes referred to as repeating subqueries). In some cases, you might need to use an inner subquery that references a value in the outer query. So far, the subqueries we’ve used have been independent of the outer query. In most cases, the performance of equivalent join or subquery operations is similar, but in some cases where existence checks need to be performed, joins perform better. Often you can achieve the same outcome with a subquery or a join, and often a subquery approach can be more easily interpreted by a developer looking at the code than a complex join query because the operation can be broken down into discrete components. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |