April 27, 2015 at 8:48 pm
Comments posted to this topic are about the item CTE Problem Redux
April 27, 2015 at 11:42 pm
Great, good to know that, thanx.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
April 28, 2015 at 12:55 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
April 28, 2015 at 1:12 am
If in the query there are many complex expressions, I prefer to name aliases in parenthesis.
April 28, 2015 at 3:39 am
Koen Verbeeck (4/28/2015)
Nice question, thanks.
April 28, 2015 at 5:02 am
Nice Question
April 28, 2015 at 5:09 am
With 87% getting it right at this point, that's encouraging. I guess I just took knowing that for granted and never gave it a second thought. It's always good to reconsider what you think you know to be true. Nice question, thanks.
April 28, 2015 at 5:28 am
Nice question, thanks!
Igor Micev,My blog: www.igormicev.com
April 28, 2015 at 7:14 am
Ed Wagner (4/28/2015)
With 87% getting it right at this point, that's encouraging. I guess I just took knowing that for granted and never gave it a second thought. It's always good to reconsider what you think you know to be true. Nice question, thanks.
+1 Great question, thanks a lot.
April 28, 2015 at 7:26 am
Hany Helmy (4/27/2015)
Great, good to know that, thanx.
+1
April 28, 2015 at 7:31 am
Ed Wagner (4/28/2015)
With 87% getting it right at this point, that's encouraging. I guess I just took knowing that for granted and never gave it a second thought. It's always good to reconsider what you think you know to be true. Nice question, thanks.
Same here. I was kind of surprised that so many got it wrong.
Good question.
_______________________________________________________________
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/
April 28, 2015 at 8:03 am
Hey, so far it is improved in % correct. Only 53% got it correct when I asked a very similar question a few years back.
http://www.sqlservercentral.com/questions/Subquery/75557/
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
April 28, 2015 at 8:04 am
Thanks for the info, good to know.
April 28, 2015 at 8:08 am
SQLRNNR (4/28/2015)
Hey, so far it is improved in % correct. Only 53% got it correct when I asked a very similar question a few years back.
Phew!!! I got yours correct too.
_______________________________________________________________
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/
April 28, 2015 at 9:57 am
SQLRNNR (4/28/2015)
Hey, so far it is improved in % correct. Only 53% got it correct when I asked a very similar question a few years back.
Well, I got today's right but yours from 2011 wrong. I am left with the conclusion that I must have learned something 3-1/2 years ago from you!
(How's that for delayed "thanks I learned something" for ya?)
As I said back in 2011 and is still true today: I never use the feature of CTEs aliasing column names in parentheses, b/c I find it more reliable to simply always code with one method of aliasing, in my SELECT list. That works regardless of query type.
Is there in fact any benefit aliasing the columns in the CTE?
Rich
Viewing 15 posts - 1 through 15 (of 22 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