October 22, 2014 at 9:28 pm
Comments posted to this topic are about the item Random unions
October 22, 2014 at 11:01 pm
This was removed by the editor as SPAM
October 23, 2014 at 12:42 am
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 23, 2014 at 1:40 am
Great simple question... Was looking for the catch, and very glad there wasn't one!
October 23, 2014 at 2:29 am
Thank you for the post, Steve, good one.
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
October 23, 2014 at 3:10 am
Michael Riemer (10/23/2014)
,,Was looking for the catch...!
If i had 1 rupee everytime i did or said that, i would have brought a 1tb PHD....:-D
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
October 23, 2014 at 4:09 am
Nice question!
I was surprised that the final RAND() also returns a constant value after a previous call with a seed. It's in the Remarks in BOL, so I guess it's by design.
October 23, 2014 at 5:21 am
A nice, basic question. Thanks, Steve.
October 23, 2014 at 5:29 am
Amusing question; the use of RAND is an interesting distraction for a question that is really about UNION ALL and nothing else.
Tom
October 23, 2014 at 6:08 am
Thanks for the easy points :hehe:
---------------
Mel.
October 23, 2014 at 6:30 am
TomThomson (10/23/2014)
Amusing question; the use of RAND is an interesting distraction for a question that is really about UNION ALL and nothing else.
I agree. I focused on what the RAND would return, and completely missed it was UNION ALL, and not UNION.
October 23, 2014 at 6:37 am
Michael Riemer (10/23/2014)
Great simple question... Was looking for the catch, and very glad there wasn't one!
The catch is that almost the same question was asked on 2014/09/29, except that one used UNION instead of UNION ALL...
October 23, 2014 at 6:52 am
Good reminder about the ALL part of UNION. I've got myself caught up when I wanted all rows and forgot to use the ALL. My duplicates, which I wanted, disappeared. Silly me.
October 23, 2014 at 9:24 am
Nice question, Steve. I thought that the values in the third column would be different in each row, but I forgot that the seeds set the sequence for subsequent calls. Fortunately, I caught the ALLs and realized that the values returned by RAND didn't matter; all three rows would be returned whether they were identical or not.
October 23, 2014 at 11:15 am
Nice question, it's not trivia and it doesn't rely on intentionally misleading syntax.
Viewing 15 posts - 1 through 15 (of 18 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy