Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by David Poole
»
Intersect, Except, Union, All and Any
87 posts, Page 9 of 9
««
«
5
6
7
8
9
Intersect, Except, Union, All and Any
Rate Topic
Display Mode
Topic Options
Author
Message
steven.malone
steven.malone
Posted Friday, December 23, 2011 8:32 AM
SSC Journeyman
Group: General Forum Members
Last Login: Thursday, April 18, 2013 6:58 AM
Points: 96,
Visits: 210
Note: I am an old curmudgeon who speaks bluntly. Nothing that follows is a personal attack. I just see this as a teachable moment.
So:
Let me get this straight:
You stumbled over some new features.
You glanced at books online
You put together some trivial tests against a trivial database
You decide you are now enough of an expert to write an article about it
You write an article that spends more time comparing the performance of trivial tests to six decimal places than into what they actually do.
If you had spent even a few minutes on Google or Wikipedia you would have learned a lot and been in a position to write a useful article.
Instead you went on the assumption that if you could find good uses for the features then there were no good uses for them. I will let you supply the adjective for that attitude.
To everyone who thought it was a great article:
It was a good topic to bring up, but did you read the other comments before you added yours?
Post #1226279
David.Poole
David.Poole
Posted Friday, December 23, 2011 11:36 AM
SSCrazy
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:16 PM
Points: 2,749,
Visits: 1,405
Let me get this straight:
You stumbled over some new features.
CORRECT
. In the Microsoft course material
You glanced at books online
Did a bit more than glance and also read what little was available in 2009. Not sure when the Wikipedia article originated as it doesn't have an original date, only a modified date in 2011.
I read BOL and the Microsoft course notes plus the standard Googling. What was available looked very like the "Other editions SQL2005" version on BOL.
You put together some trivial tests against a trivial database
CORRECT
. I did say it was Adventureworks. The whole point of using Adventureworks is that is a publicly available database. Any tests or experiments run on Adventureworks can be easily repeated and therefore verified by developers and DBAs of all levels of ability.
You decide you are now enough of an expert to write an article about it
No, I was asked by the people being put through the course what these operators were and as I hadn't seen them before I did some digging and basic experimenting.
As with any experiment
1. Document the experiment so it is repeatable and up for critique.
2. Document the results so they are verifiable
I don't have the attitude of expecting people to bask in my magnificence. I'm not that arrogant.
What I want to achieve in any article
1. Pass on what I have learnt to those coming up the ranks being very clear about my methods and experiments
2. Provoke response from the many ahead of me in the ranks so that I learn more.
Actually the forum responses did teach me something
select fieldlist from OriginalSource query Where qualifying criteria is met
intersect
select fieldlist from Targettable
Very useful in data warehouse reconcilliation.
I was arrogant enough to think that I could add some clarity to BOL.
Instead you went on the assumption that if you could find good uses for the features then there were no good uses for them.
I can't recall making that assumption, it certainly doesn't say anything about assumptions in the article?
Again the article and results are up for critique and as per the responses in the forum the true use for these operators was revealled.
I will let you supply the adjective for that attitude.
I don't have that attitude, never have had, never will have. You are very much holding the wrong end of the stick and no, I am not making the assumption that it is a stick in your hand.
Merry Christmas
LinkedIn Profile
Post #1226343
Ragesh Chavarattil
Ragesh Chavarattil
Posted Friday, December 23, 2011 11:17 PM
SSC Rookie
Group: General Forum Members
Last Login: Tuesday, February 05, 2013 5:42 AM
Points: 38,
Visits: 16
My use of Except, Intersect is to prepare a slowly changing dimension table as written below. This will help me to get the changed address as well as new records. How can i re-write this in sql without EXCEPT operand
SELECT CustomerID, Address1, District, Phone1, Phone2,....some 50 col FROM CustAddress_OLTP
EXCEPT
SELECT CustomerID, Address1, District, Phone1, Phone2,....some 50 col FROM CustAddress_SCD
Post #1226409
Tracy McKibben
Tracy McKibben
Posted Saturday, December 24, 2011 8:27 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 11:46 AM
Points: 104,
Visits: 301
I've actually used INTERSECT and EXCEPT quite a bit, not as a replacement for inner joins as some of these comments imply, but to simplify the comparison of two complex resultsets.
I've also used INTERSECT as a performance tweak:
http://www.real-sql-guy.com/2011/11/stop-performance-problem-with-intersect.html
Post #1226460
jgrattan
jgrattan
Posted Saturday, December 24, 2011 11:44 AM
Grasshopper
Group: General Forum Members
Last Login: Sunday, March 31, 2013 1:26 PM
Points: 13,
Visits: 49
Thanks for taking the time to create this post. I have often asked myself if there was any advantage in using some of these commands.
Post #1226485
villersk
villersk
Posted Monday, December 26, 2011 10:00 AM
Valued Member
Group: General Forum Members
Last Login: Tuesday, March 27, 2012 7:17 AM
Points: 51,
Visits: 167
I agree. I have found 'excep't very useful when many columns are involved in a table and I want to exclude one entire table from the other. I think you will find in that case except will outperform a join or a not in statement. At least that is what I found on sql2008 r1
Post #1226680
dbursey
dbursey
Posted Thursday, March 22, 2012 7:43 AM
SSC Rookie
Group: General Forum Members
Last Login: 2 days ago @ 2:20 PM
Points: 44,
Visits: 127
I really liked this article - very thorough. EXCEPT seems to be an analog to the Oracle MINUS, so sometimes I like it because I feel like I really know what's happening there (Oracle SQL being my first SQL language). But, my alternative is to use NOT EXISTS, so I wonder if you would consider expanding this to include the EXISTS/NOT EXISTS alternatives? I'm curious to see how they stack up within your example stream.
In general, I really liked the approach and illustrations (both pictoral and logical).
Thank you --
Donna
Post #1270852
« Prev Topic
|
Next Topic »
87 posts, Page 9 of 9
««
«
5
6
7
8
9
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.