Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / divya kalra

Subqueries can often be re-written to use a standard outer
join, resulting in faster performance. As we may know, an
outer join uses the plus sign (+) operator to tell the
database to return all non-matching rows with NULL values.
Hence we combine the outer join with a NULL test in the
WHERE clause to reproduce the result set without using a
sub-query.

Is This Answer Correct ?    4 Yes 1 No

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

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

More SQL Server Interview Questions

How many levels of sp nesting are possible?

0 Answers  


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

0 Answers  


How to view existing indexes on an given table using sys.indexes?

0 Answers  


Define Foreign Key?

3 Answers   ADP, College School Exams Tests,


What is normalization? Explain its different types?

0 Answers   GE, Maveric,


What is difference between primary key and foreign key?

0 Answers  


What is dknf in normalization form?

0 Answers  


What are scheduled tasks in sql server?

0 Answers  


What command do we use to rename a database?

0 Answers  


What is ddl command?

0 Answers  


How to edit table in sql server 2017?

0 Answers  


What is a non-clustered index?

0 Answers  


Categories