|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 4:45 PM
Points: 5,297,
Visits: 7,240
|
|
pollockk (6/30/2008) Maybe that's just because I have been caught by tables with case sensitive collations in real life.
Thanks for the clarification, Kirsty :)
I'm glad you took the question as I think the author intended it, and that you're not one of the whiney "I want my point back" types that this site unfortunately appears to have too many of (I am in fact surprised that as of yet, there still aren't two to three pages of such replies ).
And I know all about being caught by this - most of my databases use a binary collation (for that tiny bit of extra speed :)), so I often have to correct lots of upper-/lowercase problems when copying sample code from any online resource...
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, July 31, 2008 2:42 AM
Points: 9,
Visits: 24
|
|
glad that's sorted then. I'm not even playing for points so any and all comments/questions of mine can be taken to be innocent of motive .
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Monday, June 17, 2013 8:50 AM
Points: 583,
Visits: 291
|
|
just to let you know I'm not picky either. Sorry if I seemed to be from my reply I just wanted to state that it was confusing (for me at least). Who cares about the points? I'm just here to learn...
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, April 06, 2009 1:29 PM
Points: 2,057,
Visits: 215
|
|
| I use to worry about the points, but life is too short to worry about such unimportant things like that.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, January 08, 2009 1:32 AM
Points: 129,
Visits: 35
|
|
I just noticed that the answer says "A ->= would return true", while I guess the author had "<=" in mind... ;)
Thanks for the collation hint, I ran into such tricky problems too, a couple of times :)
I considered those values a kind of "meta-values", meaning that they were generic values, so didn't pay much attention to their case
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, February 04, 2013 10:00 AM
Points: 1,329,
Visits: 803
|
|
Well, I got caught by the collation thing as well. When I looked at the expression and the values to test, I did go review an ASCII chart before answering. A capital V has a decimal value of 86 while a lower case v has a decimal value of 118. The IF statement is checking to see if 'Value1' is less than ALL of the values returned from the subquery (those values being value1, value2, value3, value4).
'Value1' is obviously less than the last three which left the first one to question. If the database is NOT CaSe sensitive, the result would be 0 since 'Value1' is = to 'value1'.
If the database IS CaSe sensitive, the result would be 1 since 'Value1' is < 'value1'. I answered as if the database were CaSe sensitive and therefore got the answer wrong. There have been CaSe questions before so really, both answers are correct since the collation was not specified as part of the question.
Not a bad question but this small piece of information was left out so it could not be answered correctly.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 8:30 AM
Points: 1,419,
Visits: 267
|
|
Objection!!
Value1 is indeed LESS THAN value1, no matter how many times value1 appears in the table.
Therefore I claim my points.
AND don't claim that you didn't mention case sensitivity, because we don't allow any assumptions! We take it at face value.
Kenneth Spencer
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Yesterday @ 5:09 AM
Points: 31,526,
Visits: 13,864
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 8:30 AM
Points: 1,419,
Visits: 267
|
|
Thanks Steve, that is indeed very kind of you !! And I won't hold it against you just because you are from the US !!!
Ken.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Monday, June 17, 2013 8:50 AM
Points: 583,
Visits: 291
|
|
|
|
|