February 13, 2013 at 9:44 pm
Nice question Kristian! Thanks 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
February 14, 2013 at 12:09 am
Great question, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 14, 2013 at 2:31 am
Good question. I learn something new !!!
Thanks
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
February 14, 2013 at 2:43 am
Nice question, thanks
February 14, 2013 at 3:13 am
Nice question on merge!
February 14, 2013 at 3:13 am
This was removed by the editor as SPAM
February 14, 2013 at 4:11 am
Thank you for the question and lesson.
February 14, 2013 at 7:05 am
Thanks for the question, Ole. Interesting.. (before I knew very little about the merge, but know even little bit more... 🙂 )
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
February 14, 2013 at 7:13 am
Good question, learned something I didn't know about Merge and I use it not every day, but at least every other week. 🙂
February 14, 2013 at 7:58 am
Ugh, apparently I really need to use MERGE more often.
Thanks for the great question!
February 14, 2013 at 8:04 am
What's Merge got to do with Valentine's Day?? 😉 Just kidding, good question!
February 14, 2013 at 8:46 am
Great question... learnt something new today..! Thanks for the qotd
___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic.. :hehe:
February 14, 2013 at 8:52 am
Nice question. However, the explanation would have been better if it had pointed out that filters like this can be placed in the when matche/not matched conditions. In this merge statement the when clause should have been when not matched by target and src.RowNo = 1
if the intention was to get only the three rows with RowNo 1.
In fact even filtering of the target table in the on clause other than with a matching codition between source and target is stated by MS to be bad practice, as it can lead to unexpected results (ie it doesn't necessarily do what you would expect it to do).
BoL
It is important to specify only the columns from the target table that are used for matching purposes. That is, specify columns from the target table that are compared to the corresponding column of the source table.
Tom
February 14, 2013 at 9:15 am
Terrific and subtle point. You got me. Any "filtering" must be done in the WHEN [NOT] MATCHED AND xxx clause.
Viewing 15 posts - 1 through 15 (of 39 total)
You must be logged in to reply to this topic. Login to reply