Can we rewrite subqueries into simple select statements or
with joins? Example?
Answer Posted / divya kalra
Subqueries can often be re-written to use a standard outer
join, resulting in faster performance. As we may know, an
outer join uses the plus sign (+) operator to tell the
database to return all non-matching rows with NULL values.
Hence we combine the outer join with a NULL test in the
WHERE clause to reproduce the result set without using a
sub-query.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What can be used instead of trigger?
How to create prepared statements using odbc_prepare()?
What is the command used to recompile the stored procedure at run time?
List out the differences between the clustered index and non-clustered index in sql server?
What is apply operator in sql?
Difference between Inner vs outer joins?
Do comments need to go in a special place in sql server 2005?
Explain what is the difference between union and union all?
List some advantages and disadvantages of stored procedure?
Explain the steps to create and execute a user-defined function in the sql server?
How you can change the database name in SQL SERVER?
What is isnull() operator?
How to create an multi-statement table-valued function?
What is normalization of database? What are its benefits?
What are the main differences between #temp tables and @table variables and which one is preferred?