Solved

Can I perform a minus operation between two result sets, like oracle's MINUS operator?

Posted on 2002-03-18
2
1,169 Views
Last Modified: 2010-08-05
Hello

sample :

Two result sets: A and B.
I want a new set : A-B

Regards
C.M
0
Comment
Question by:cmurugavel
2 Comments
 
LVL 9

Expert Comment

by:ornicar
Comment Utility
You can use the NOT EXISTS statement. It will be something like:

select * from a
where not exists (select * from B where A.keycolumn = B.keycolumn)
0
 
LVL 5

Accepted Solution

by:
amitpagarwal earned 50 total points
Comment Utility
or you could use a temp table approach ...

select * into #a from tableA

delete #a
from #a, tableB
where #a.keyCol1 = tableB.keyCol2
and #a.keyCol2 = tableB.keyCol2 .....

select * from #a

this would give u the desired result set..


cheers !!!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now