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

System variable and temporary variables

1084


What can be used instead of trigger?

4


What is the use of tempdb? What values does it hold?

3


tell me the disaster recovery plan

1396


How many databases Microsoft SQL server provides?

4






New concepts of sql server 2005 use in your project.

1334


How retrieve field names from the table in SQL through JAVA code?

799


what are the critical issues you have resloved in your company

940


what exactly sql injuction.how to overcome.....

1414


You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?

1153


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

2869


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

1262


can any body tell me how to know the password of current user in sql server

1011


sql database suspect We have a sql database that is showing as suspect. How can we recover?

820


your distribution database is full what will u do

1068