November 29, 2011 at 8:35 pm
Comments posted to this topic are about the item Variant order 1
Tom
November 29, 2011 at 8:36 pm
November 29, 2011 at 10:06 pm
even though x=y, and y=x, your case statement catered for the following result:
'v3 = v2'
and no where specifies v2=v3.
"None of the Above" should be correct as well.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
November 29, 2011 at 10:46 pm
I agreed!
From the programming logic, "v2 = v3" could not be displayed! In fact, the right answer should be "None of the above". If the editor admit that it is a typo mistake, then both "v2 = v3" and "None of the above" should be correct in order to be fair.
November 29, 2011 at 11:25 pm
Tom
Thanks for a REALLY interesting QotD. I wish I came up with this one.
November 30, 2011 at 1:34 am
Nice question Tom.
November 30, 2011 at 1:57 am
Must say I agree with Henrico Bekker, the case statements at no point say v2 = v3, but rather v3 = v2. Whilst the mean the same thing, I agree that None of the Above should also be an applicable answer for those who are being pedantic.
November 30, 2011 at 2:30 am
Got it wrong because I believe it should say "v3 = v2" not "v2 = v3"
November 30, 2011 at 2:31 am
Answer is v1 > v2v1 > v3v3 = v2v4 > v1
and not "v1 > v2v1 > v3v2 = v3v4 > v1"
November 30, 2011 at 3:20 am
good question and explanation!!!!
thanks Tom!!!
November 30, 2011 at 3:25 am
Good question. Thanks, Tom! 😉
To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.
November 30, 2011 at 3:35 am
While not exactly a comment on the outcome of this question, I do wonder whether people out there actually use variants. I never have, and also don't see the case for them.
The QotD seems increasingly to have very "clever" questions about T-SQL behaviour that are most esoteric and have little bearing on my day to day use of the language.
Or maybe I'm just weird :hehe:
November 30, 2011 at 3:42 am
Hugo Kornelis (11/30/2011)
To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.
Same here, but that was largely because I've followed Tom's comments on these forums for a while and didn't think he'd resort to trick questions 🙂
November 30, 2011 at 3:54 am
Toreador (11/30/2011)
Hugo Kornelis (11/30/2011)
To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.Same here, but that was largely because I've followed Tom's comments on these forums for a while and didn't think he'd resort to trick questions 🙂
True that. Would the question have come from someone I didn't know yet, I would have picked the same answer, but with less confidence in the outcome. It is a sad fact that some of the questions submitted to the QotD are indeed trick questions.
November 30, 2011 at 4:22 am
Good question thanks Tom. Made learn more about sql_variant comparisons.
Got the answer wrong though as thought it was a trick question too.
Viewing 15 posts - 1 through 15 (of 58 total)
You must be logged in to reply to this topic. Login to reply