January 27, 2015 at 9:35 pm
Thanks for question.Easy +2 points 🙂
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
January 28, 2015 at 12:04 am
This was removed by the editor as SPAM
January 28, 2015 at 12:24 am
Easy one. I use it a lot to test two tables (one from test and one from prod) to see if the data is equal or not.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 28, 2015 at 12:37 am
Thank you Steve for the post, good one.
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
January 28, 2015 at 2:35 am
Got it wrong as did not read the question properly...that said I may have got it wrong anyway as learnt something new today. Thanks for that. 😀
January 28, 2015 at 2:46 am
I changed the query to be this
SELECT
Salesyear
, complete
, amount
FROM
sales
WHERE
customerid = 2
EXCEPT
SELECT
Salesyear
, complete
, amount
FROM
sales
WHERE
customerid = 1
I expected to see 2 rows but returned 1 only. Not sure why (other than me being thick).
January 28, 2015 at 3:05 am
This was removed by the editor as SPAM
January 28, 2015 at 3:20 am
EXCEPT[/url] Returns distinct rows by comparing the results of two queries.
Given that the last 2 records for client 2 are the same, only one row will be returned
thank you for this. Now read up on instead of playing. Now learnt that should read before posting!!
January 28, 2015 at 7:34 am
good one, thanks
January 28, 2015 at 9:48 am
Except is a really fast way of accomplishing it, too. When compared with the other methods I've tried, this is clearly the fastest.
January 28, 2015 at 10:20 am
I never use this. Thanks for the new "learnt".
January 28, 2015 at 10:34 am
Easy one for me this time, thanks. I use this in a few of my queries.
February 19, 2015 at 12:24 am
Easy one for me. But good basic question. 🙂
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply