Can we rewrite subqueries into simple select statements or
with joins? Example?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How raid can influence database performance?

676


What is difference between commit and rollback when used in transactions?

576


How to find out the list schema name and table name for the database?

624


Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?

151


Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio

598






How to disable stored procedure sql server?

1099


What are sql servers used for?

605


Tell me about builtinadministrator?

648


Define cross join in sql server joins?

658


Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

666


You want to implement the one-to-many relationship while designing tables. How would you do it?

590


What is the order by used for?

710


What is the importance of concurrency control?

800


What is dimension table? : sql server analysis services, ssas

650


What are various limitations of the views?

703