June 14, 2015 at 8:48 am
roopa.subbareddy (6/14/2015)
There is no Single quotes in the Select for the phone number. So it must give an error message.
Try running the code. You'll see that the integer values are silently converted to character without raising an error.
June 15, 2015 at 10:08 am
Hany Helmy (6/14/2015)
Nice tricky question, thanx.
I thought it was quite a nice question.
It seemed pretty trick-free to me, although you did have to remember three facts: (i) that UNION is a set operation (unlike UNION ALL, which is a bag operation), (ii) that integers used in a string context are converted automatically to string, and (iii) that 1234512345 is small enough to be representable in the INT type.
Tom
June 16, 2015 at 4:44 am
Easy one, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 25, 2015 at 6:40 am
An easy one, now that I have learned the difference between UNION and UNION ALL.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply