January 24, 2013 at 8:38 pm
Comments posted to this topic are about the item Question of the day
January 24, 2013 at 10:11 pm
Used these many times but had to read to make sure I get it right. Thanks for the question. +1
January 24, 2013 at 10:25 pm
January 24, 2013 at 11:06 pm
Nice question. Thanks!
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
January 24, 2013 at 11:08 pm
nice and easy ..
thanks
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
January 24, 2013 at 11:15 pm
I am getting myself confused with some simple maths :crazy:
Answer 1
Coalesce can take more than two parameters, and IsNULL takes exactly two parameters
97%
Answer 5
Coalesce takes exactly two parameters, and IsNULL takes more than two parameters
6%
Does this mean somebody selected these two options as an answer?
January 24, 2013 at 11:22 pm
Easy One.. Thanks for the point.
I think few days back had a discussion about data type precedence of COALESCE.
--
Dineshbabu
Desire to learn new things..
January 25, 2013 at 12:02 am
Nice QtoD. (even though if it looks simple, it is not, makes you think.... 🙂 )
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
January 25, 2013 at 12:31 am
Easy Friday question, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 25, 2013 at 12:53 am
Nice and straightforward way to end the week - thanks.
Can't see there'll be much debate about this one!
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
January 25, 2013 at 1:25 am
January 25, 2013 at 1:33 am
nice question... i am bit confusion about the point "The return type of COALESCE does depend on the data type precedence rules". can u explain any body?????
Manikandan.ps
Move fast as possible...................
Manik
You cannot get to the top by sitting on your bottom.
January 25, 2013 at 1:40 am
January 25, 2013 at 1:40 am
manik123 (1/25/2013)
i am bit confusion about the point "The return type of COALESCE does depend on the data type precedence rules". can u explain any body?????
See http://msdn.microsoft.com/en-us/library/ms190309.aspx for the data type precedence - the rules that determine the return data type of any operation in SQL Server that combines different data types - except ISNULL, where the return type is always that of the first parameter and the rules of data type precedence don't apply.
January 25, 2013 at 1:46 am
manik123 (1/25/2013)
nice question... i am bit confusion about the point "The return type of COALESCE does depend on the data type precedence rules". can u explain any body?????Manikandan.ps
Move fast as possible...................
Hi manik123
Datat type of the result returned by COALESCE will be highest precedence of all arguments used in the function. So all the arguments used inside Coalesce should be implictly convertible to the highest precedence otherwise u will get a conversion error.
For example.
SELECT COALESCE('abcd',GETDATE())
Will return datatype conversion error.
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
Please refer this link for further detail & examples
--
Dineshbabu
Desire to learn new things..
Viewing 15 posts - 1 through 15 (of 38 total)
You must be logged in to reply to this topic. Login to reply