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
How to list all field names in the result set using mssql_field_name()?
Is it ok to shrink transaction log?
What is the purpose of sql profiler in sql server? : sql server database administration
What is an indexing strategy?
Where is my database stored on the hard disk in ms sql server?
Can coalesce return null?
How do you create an execution plan?
how to take backup bcp out for a column in table in sql server?
What is report snapshot?
How to count groups returned with the group by clause in ms sql server?
What objects does the fn_my_permissions function reports on? : sql server security
Can an automatic recovery be initiated by a user?
What is the difference between local and global temporary tables?
What can be used instead of trigger?
What is sql server management studio? : sql server management studio