SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ALL


Author
Message
Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18615 Visits: 12426
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 Smile

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 w00t ).

And I know all about being caught by this - most of my databases use a binary collation (for that tiny bit of extra speed Smile), so I often have to correct lots of upper-/lowercase problems when copying sample code from any online resource... Sad


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
pollockk
pollockk
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 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 :-).
thierry.vandurme
thierry.vandurme
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1370 Visits: 559
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...
Steven Cameron
Steven Cameron
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2213 Visits: 215
I use to worry about the points, but life is too short to worry about such unimportant things like that.
luca.pierobon
luca.pierobon
SSC-Enthusiastic
SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)

Group: General Forum Members
Points: 131 Visits: 35
I just noticed that the answer says "A ->= would return true", while I guess the author had "<=" in mind... Wink

Thanks for the collation hint, I ran into such tricky problems too, a couple of times Smile

I considered those values a kind of "meta-values", meaning that they were generic values, so didn't pay much attention to their case Cool
jim.powers
jim.powers
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2788 Visits: 871
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.
kaspencer
kaspencer
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2658 Visits: 857
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

You never know: reading my book: "All about your computer" might just tell you something you never knew!
lulu.com/kaspencer
Steve Jones
Steve Jones
SSC Guru
SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)

Group: Administrators
Points: 144170 Visits: 19424
I'll award points back to you, since the narrow minded US author (me) didn't think in terms of case sensitivity. I'll try to consider that for future questions.

The question has been altered to clarify and correct the Value1 v value1 typo.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
kaspencer
kaspencer
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2658 Visits: 857
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.

You never know: reading my book: "All about your computer" might just tell you something you never knew!
lulu.com/kaspencer
thierry.vandurme
thierry.vandurme
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1370 Visits: 559
gij onnozel manneke...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search