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

what types of replication are supported in sql server? : Sql server database administration

453


How will you know when statistics on a table are obsolete?

591


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

614


Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .

1476


What is resultset concur_updatable?

571






Determine when an index is appropriate?

541


Explain Reporting Life Cycle?

90


What is ms sql server index?

551


How to replace null values in expressions using isnull()?

636


What is the standby server?

508


Which are the olap features?

535


How to identify current user in ssrs report?

238


What is the difference between for xml raw and for xml auto?

551


What are the types of user defined functions in sql server?

488


How sql server enhances scalability of the database system?

575