March 1, 2018 at 8:26 pm
Comments posted to this topic are about the item The Values Clause
March 2, 2018 at 5:39 am
Nice question, Steve. Table-value constructors are a super-handy tool to have.
March 2, 2018 at 7:26 am
Interesting!
March 2, 2018 at 7:39 am
Nice question to end the week on. Easy peasy if you use these all the time. 🙂
_______________________________________________________________
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/
March 2, 2018 at 9:04 am
Yes, nice and easy one for a Friday. I have one silly question though... if you have a table value constructor that explicitly already has the unique numbers 1 to 10, why would you need the ROW_NUMBER() evaluation? I could see if the script was using the Itzik Ben-Gan cross join method of producing a larger number set.
March 5, 2018 at 3:43 am
Nice one, thanks Steve
Real handy to have this in your arsenal.
TVC's have saved my bacon on numerous occasions....
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
March 5, 2018 at 6:43 am
Chris Harshman - Friday, March 2, 2018 9:04 AMYes, nice and easy one for a Friday. I have one silly question though... if you have a table value constructor that explicitly already has the unique numbers 1 to 10, why would you need the ROW_NUMBER() evaluation? I could see if the script was using the Itzik Ben-Gan cross join method of producing a larger number set.
Mainly so that if you add a cross join, copy/paste the second line, you don't have to edit more of the query.
March 5, 2018 at 8:34 am
Thanks for this instructive question.
- webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply