Can we rewrite subqueries into simple select statements or
with joins? Example?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / syed sajjad
Yes we can write using Common Table Expression (CTE). A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution of a single SQL statement. A CTE is similar to a derived table in that it is not stored as an object and lasts only for the duration of the query.
Is This Answer Correct ? | 1 Yes | 0 No |
What does it mean to manipulate data?
Differentiate between a primary key and a unique key.
Why use update_statistics command in sql server?
What is the process of normalising?
what are the disadvantages of cursors? : Sql server database administration
plz send every query in sql server2000
What is filtered index?
What is the difference between online clustering and Offline clustering?
What is stored in the mssqlsystemresource database? : sql server database administration
How to find the date and time of last updated table?
What are the different types of backup avaible in SQL SErver
Are connections to sql server encrypted?