Derived Tables

1. Derived Tables are nothing but using a result of a query as a table.
2. This is much better than using temporary tables.
3. This increases the performance.
4. The below shows how to return employee and department info for those who don’t belong to a inactive department

Select EmployeeID, FirstName, LastName, Dt.DeptName from Employee INNER JOIN (Select * from Dept where Status !='InActive') Dt ON Dt.DeptID = Employee.DeptID

Comments

Whats the diff between using regular inner and derived table for this particular example?

Popular posts from this blog

“Unable to retrieve the metadata for …” Error while using ASP.NET MVC 3

Building application using ASP.NET MVC and MongoDB

Getting Started with ASP.NET MVC, SignalR KnockoutJS