Saturday, April 12, 2008

Minus Keyword in SQL Server

Minus Keyword in SQL Server 2000

Oracle supports "Minus" Keyword, but today suddenly when i tried to execute same in SQL Server it won't work.

So, I have found out Alternate way to use "Minus" in SQL Server

Alternate Way for "Minus" Keyword in SQL Server is used "Except" Keyword

Example:

Select City, State
from Employee
Minus
Select City, State
from Customer

This will work fine with Oracle, but won't work with SQL Server.

So alternate way to use "Minus" Keyword in SQL Server

Select City, State
from Employee
Except
Select City, State
from Customer

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape