November 24, 2014 at 8:27 am
Koen Verbeeck (11/24/2014)
Nice question. I have been bitten by the windowing functions defaults before, so this question was easy 😀(I even wrote a blog post about it: Beware the defaults! (in windowing functions)[/url]. Shameless plug :-). Somehow it didn't make it to the explanation :hehe:)
Thanks for the article. It was very helpful.
November 24, 2014 at 8:30 am
TomThomson (11/24/2014)
Nice question, but I have two queries about it:(i) why 2 points? it's just extremely simple logic.
(ii) why use first_value and DESC when last_value would do, so that the code could be 6 characters (including the space before DESC) shorter?
See the article that Koen linked in his first reply. It gives a very good explanation.
November 24, 2014 at 9:15 am
Thanks for the question. Though I'm not on 2012, the correct answer seemed like the logical choice.
November 24, 2014 at 10:02 am
Thanks for the question. Seemed easy enough, but was sufficiently challenging for a Monday.
Saw Koen's plug for his blog. Can we get him to rewrite BOL too?
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
November 24, 2014 at 10:59 am
This was removed by the editor as SPAM
November 24, 2014 at 12:35 pm
Stewart "Arturius" Campbell (11/24/2014)
Thomas Abraham (11/24/2014)
Thanks for the question. Seemed easy enough, but was sufficiently challenging for a Monday.Saw Koen's plug for his blog. Can we get him to rewrite BOL too?
Now that is a good idea...
I'll send my hourly rate to Microsoft! 😎
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 25, 2014 at 6:30 am
Koen Verbeeck (11/24/2014)
Stewart "Arturius" Campbell (11/24/2014)
Thomas Abraham (11/24/2014)
Thanks for the question. Seemed easy enough, but was sufficiently challenging for a Monday.Saw Koen's plug for his blog. Can we get him to rewrite BOL too?
Now that is a good idea...
I'll send my hourly rate to Microsoft! 😎
I'm sure you'll get an enthusiastic response. 😉
November 28, 2014 at 4:30 am
marcia.j.wilson (11/24/2014)
TomThomson (11/24/2014)
Nice question, but I have two queries about it:(i) why 2 points? it's just extremely simple logic.
(ii) why use first_value and DESC when last_value would do, so that the code could be 6 characters (including the space before DESC) shorter?
See the article that Koen linked in his first reply. It gives a very good explanation.
Yes, a good article.
I would say that this is a severe case of badly chosen defaults, but that's nothing unusual, I guess. I would have expected the default to be all rows in the partition, as someone else said. This question and discussion have saved me from finding out the hard way than the default is quite different.
Tom
November 28, 2014 at 4:35 am
TomThomson (11/28/2014)
marcia.j.wilson (11/24/2014)
TomThomson (11/24/2014)
Nice question, but I have two queries about it:(i) why 2 points? it's just extremely simple logic.
(ii) why use first_value and DESC when last_value would do, so that the code could be 6 characters (including the space before DESC) shorter?
See the article that Koen linked in his first reply. It gives a very good explanation.
Yes, a good article.
Thanks for the kind words. :blush:
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 9 posts - 16 through 23 (of 23 total)
You must be logged in to reply to this topic. Login to reply