January 7, 2013 at 9:07 pm
Comments posted to this topic are about the item Coalesce and Conversion
Tom
January 7, 2013 at 9:12 pm
I missed it completely 🙁
. no regret , learned something .
Also, I am glad to see that on aswering the question, equation for right and wrong is 0% and 100 %
Thanks for the question ..
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
January 7, 2013 at 10:07 pm
Thanks for the question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
January 7, 2013 at 10:34 pm
Nice Question. Learnt something for today.
January 8, 2013 at 12:13 am
still now i thought COALESCE will return the datatype of Non NUll value. Today only i learnt it will consider the highest percedence..
Thanks to author for posting nice qstn..
--
Dineshbabu
Desire to learn new things..
January 8, 2013 at 12:31 am
Great and very interesting question. Thanks Tom!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 8, 2013 at 4:12 am
Thanks for the great question! A true learning question with no controversy.
January 8, 2013 at 4:57 am
Well, the question is a good one, and I got it right, but if I see code like that I reach for the shot gun.
January 8, 2013 at 6:55 am
Koen Verbeeck (1/8/2013)
Great and very interesting question. Thanks Tom!
+1 I must agree... was a lot of fun to sit there pondering if all of the various data types would be compatible with each other. Now where did I put that Ibuprofen? heh
January 8, 2013 at 7:20 am
Good question Tom. Good to have a refresher on these things from time to time.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
January 8, 2013 at 8:25 am
This was removed by the editor as SPAM
January 8, 2013 at 9:14 am
Excellent question, and great explanation! Thanks!
Rob Schripsema
Propack, Inc.
January 8, 2013 at 10:32 am
How annoying. You made me think! 😉
I agree this was an excellent question and explanation. I do see that one minor correction could be needed to one example given, however. You say "...for example the numeric value 37.2 can be converted to an int (37)...". Did you actually mean that an INT (@i) could be converted to the higher precedence numeric type, as obviously could be the literal value 37.2? After all, the result of that coalesce is 37.2 and not 37.
January 8, 2013 at 12:07 pm
A really good QotD. Thanks, Tom!
Viewing 15 posts - 1 through 15 (of 23 total)
You must be logged in to reply to this topic. Login to reply