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

Explain the properties of a relational table?

9


as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration

15


Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?

16


What is catalog views?

14


What is cursors? And what are the different types of cursor?

26






How you can get a list of all the table constraints in a database?

14


Explain the creation and execution of a user-defined function in the sql server?

16


What is log cache in sql server?

2


Explain the database you used in your final year project?

35


How to create a view with data from multiple tables?

16


How to create new databases with "create database" statements?

14


What is the difference between stored procedure and user defined functions?

35


What do you need to connect php to sql server?

16


Explain primary key?

25


which backup strategy you are following at ur company

1153