top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is difference between derived table and sub query in sql server

+3 votes
790 views
What is difference between derived table and sub query in sql server
posted Jan 24, 2014 by Neeraj Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

derived tables and subqueries can look the same and many people may even think they are the same thing, but there are definitely differences. Don’t worry, even if you don’t know what a derived table or a subquery is in SQL, it should be clear by the time you are done reading below.

A subquery is a SELECT statement that is nested within another statement – that’s why it’s called a subquery, because it’s like having a query within another query . Subqueries are usually used in the WHERE clause as a way to filter out certain rows returned in the result set of the outer query.

answer Jan 26, 2014 by Prachi Agarwal
...