July 7, 2012 at 2:45 pm
Comments posted to this topic are about the item Union and Union All
July 7, 2012 at 2:45 pm
July 8, 2012 at 11:36 am
bitbucket-25253 (7/7/2012)
Nice to be reminded of the basics
+1
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
July 8, 2012 at 9:45 pm
nice one...
Regards,
Ravi.
July 8, 2012 at 10:40 pm
A really easy one for my Sunday evening... but it is always good to brush up on he basics.
Thanks, Sanjeewan!
July 9, 2012 at 12:25 am
Easy one to start the week.:-)
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂
July 9, 2012 at 12:30 am
A little bit too easy. But then again, it's Monday...
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 9, 2012 at 1:27 am
Koen Verbeeck (7/9/2012)
A little bit too easy. ...
I don't mind. After the shenanigans of last week it's nice to have a question that really does only have one possible answer! 😀
July 9, 2012 at 2:19 am
This was removed by the editor as SPAM
July 9, 2012 at 2:45 am
Question. Answer. Sorted.
July 9, 2012 at 3:51 am
Nice and simple back to basics, perfect for a Monday.
Thanks 😀
_____________________________________________________________________
[font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]
July 9, 2012 at 4:35 am
Though I was a little disappointed that it could not have been A, B, A as well, after indexgate, I did manage to get the idea fairly directly.
July 9, 2012 at 4:39 am
nice and easy.
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
July 9, 2012 at 4:41 am
Not a bad question, and got me thinking about other possible questions, so here goes - how many rows are returned in the two following cases?
-- Query 1
SELECT 'A'
UNION ALL
SELECT 'A'
UNION
SELECT 'A'
-- Query 2
SELECT 'A'
UNION
SELECT 'A'
UNION ALL
SELECT 'A'
Try to guess first, then use MS to verify. 😀
July 9, 2012 at 5:08 am
For one moment, I thought there was a catch somewhere as the question and code all looked very easy.
It's interesting how the first part of the UNION is a derived table without an outer SELECT. I thought that would raise an error. But it seems the query processor changes the order of the UNION? (EDIT: No, it doesn't.)
Excellent question to start the week. Thank you.
EDIT: Nevermind. I was confused with the parenthesis. SQL Server will allow that just fine. Need more coffee.
Best regards,
Andre Guerreiro Neto
Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2/MCSE/MCSA
Viewing 15 posts - 1 through 15 (of 37 total)
You must be logged in to reply to this topic. Login to reply