Tuesday, March 27, 2007
Wednesday, March 14, 2007
Except and Intersect
Here's a powerful feature of SQL Server 2005:
EXCEPT and INTERSECT are operands that return distinct results from automatic joins on every column in two selects.
SELECT ProductID
FROM TableA
EXCEPT
SELECT ProductID
FROM TableB
is equivalent to
SELECT ProductID
FROM TableA
LEFT OUTER JOIN TableB ON TableA.ProductID = TableB.ProductID
WHERE TableB.ProductID IS NULL
the advantage of EXCEPT would grow with more columns to compare.
INTERSECT returns the equivalent of the distinct results of an inner join on every column selected on both sides of the INTERSECT operand.
Labels: sql
Saturday, March 03, 2007
LINQ
LINQ is going to be an important part of database app development (.NET platform). Here's your chance to get a preview:
Microsoft's LINQ project site
"DLinq, a component of the LINQ Project, provides a run-time infrastructure for managing relational data as objects without giving up the ability to query."
Labels: LINQ