<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx</link><description>It's been quite a while since the LIKE vs ? Puzzle , and I feel like it's time for another one. Response was overwhelming last time, and I'm back with a much tougher puzzle and a much bigger prize. So get ready, because I'm going to really make you stretch</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12311</link><pubDate>Fri, 27 Feb 2009 19:26:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12311</guid><dc:creator>Aaron Alton</dc:creator><description>&lt;p&gt;What a cool challenge.....&lt;/p&gt;
&lt;p&gt;Do you consider a Common Table Expression to be a &amp;quot;temporary object&amp;quot;? &amp;nbsp;It usually hashes out the same, but I find that CTE's can significantly improve readibility.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12312</link><pubDate>Fri, 27 Feb 2009 19:32:37 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12312</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Aaron,&lt;/p&gt;
&lt;p&gt;Great question, and the answer is no -- a CTE is not a temporary object but rather part of a bigger statement. &amp;nbsp;All of the following (among other things) are most definitely allowed:&lt;/p&gt;
&lt;p&gt;CTEs&lt;/p&gt;
&lt;p&gt;Derived Tables&lt;/p&gt;
&lt;p&gt;Subqueries&lt;/p&gt;
&lt;p&gt;I'll even go so far as to say that any relational operator is also allowed, including UNION, UNION ALL, EXCEPT, INTERSECT. If you can't get the whole result in one query, perhaps you can get it in two or more?&lt;/p&gt;
&lt;p&gt;As an aside, I would also like to note that you should not rely on any specific data in the target tables. I will be testing on modified (larger) versions of the tables. &amp;nbsp;Same indexes, but different data -- so no "cute" attempts to send me all of the data in a bunch of UNIONed SELECTs (which would be a single statement according to the rules of the game, but wouldn't pass my correctness test and would be a complete waste of time for everyone involved).&lt;/p&gt;</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12313</link><pubDate>Fri, 27 Feb 2009 19:42:38 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12313</guid><dc:creator>Cade Roux</dc:creator><description>&lt;p&gt;Any chance of a known good target output we can use to run tests against?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12315</link><pubDate>Fri, 27 Feb 2009 19:50:23 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12315</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Cade,&lt;/p&gt;
&lt;p&gt;Sure, I'll get something attached to the post shortly.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12318</link><pubDate>Fri, 27 Feb 2009 20:11:05 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12318</guid><dc:creator>Matija Lah</dc:creator><description>&lt;p&gt;Well, there are commas in Product.Name values.&lt;/p&gt;
&lt;p&gt;Are we allowed to use semi-colons to separate individual product names?&lt;/p&gt;
&lt;p&gt;(I'm OK with commas, personally, but readability my be an issue.)&lt;/p&gt;
&lt;p&gt;:)&lt;/p&gt;
&lt;p&gt;ML&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12319</link><pubDate>Fri, 27 Feb 2009 20:15:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12319</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Matija,&lt;/p&gt;
&lt;p&gt;You're right, there are commas in there, and that was probably a bad choice of delimiter on my part. &amp;nbsp;But we'll stick with it. &amp;nbsp;Please preserve any commas and formatting already in the data. &amp;nbsp;Add only a single additional comma, and no additional white space, in your output.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12320</link><pubDate>Fri, 27 Feb 2009 20:18:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12320</guid><dc:creator>Roy Harvey</dc:creator><description>&lt;p&gt;In the copy of AdventureWorks that I am working with, the column Production.Product.Name has 214 rows with commas already embedded in the data. &amp;nbsp;(290 rows have no comma.) &amp;nbsp;Do you expect that data to be handled in any particular way? &amp;nbsp;Unlike the specifications you provided the embedded commas all appear to be followed by a blank.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12321</link><pubDate>Fri, 27 Feb 2009 20:18:29 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12321</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Update: Sample output is now attached to this post. If your query can match that output, you're already halfway there. See how easy I'm making this?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12322</link><pubDate>Fri, 27 Feb 2009 20:18:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12322</guid><dc:creator>Roy Harvey</dc:creator><description>&lt;p&gt;Never mind!&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12326</link><pubDate>Fri, 27 Feb 2009 20:40:03 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12326</guid><dc:creator>Cade Roux</dc:creator><description>&lt;p&gt;Looks like we're leaving out customers without order, correct?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12327</link><pubDate>Fri, 27 Feb 2009 20:42:54 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12327</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;Your example file for TotalDollarAmount is erraneous.&lt;/p&gt;
&lt;p&gt;For Customer ID 1 (Orlando Gee), which has 4 orders (SO43860, SO44501, SO45283 and SO46042), the TotalDollarAmount is &lt;/p&gt;
&lt;p&gt;13216.0537 + 23646.0339 + 34066.1881 + 31423.5209 = 102351.7966&lt;/p&gt;
&lt;p&gt;Not 1967445.6889&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12328</link><pubDate>Fri, 27 Feb 2009 20:55:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12328</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Cade: Yes&lt;/p&gt;
&lt;p&gt;Peso: Just making sure you were paying attention &amp;lt;g&amp;gt; ... the file has been updated with correct values. &amp;nbsp;Thanks for pointing that out!&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12330</link><pubDate>Fri, 27 Feb 2009 21:07:09 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12330</guid><dc:creator>Cade Roux</dc:creator><description>&lt;p&gt;I'm sorry to say I'm not terribly familiar with the AdventureWorks schema. &amp;nbsp;What's the rule for choosing Store Contacts for a customer of store type? &amp;nbsp;I've got the &amp;quot;hard stuff&amp;quot; working, but I'm having trouble selecting a First Name and Last Name for &amp;quot;Store&amp;quot; type customers who have multiple contacts, like CustomerID = 2:&lt;/p&gt;
&lt;p&gt;FirstName	LastName&lt;/p&gt;
&lt;p&gt;Keith	Harris&lt;/p&gt;
&lt;p&gt;Geraldine	Spicer&lt;/p&gt;
&lt;p&gt;So I'm ending up with multiple rows for some customers.&lt;/p&gt;
&lt;p&gt;I find there are some customers with both owners and purchasing managers. &amp;nbsp;I didn't see any useful views or UDFs in the database.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12331</link><pubDate>Fri, 27 Feb 2009 21:11:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12331</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;A dumb question.&lt;/p&gt;
&lt;p&gt;Where do I send my solution?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12332</link><pubDate>Fri, 27 Feb 2009 21:11:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12332</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Cade,&lt;/p&gt;
&lt;p&gt;Just go straight to Person.Contact with the ContactID.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12333</link><pubDate>Fri, 27 Feb 2009 21:17:38 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12333</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Peso:&lt;/p&gt;
&lt;p&gt;[my first name] [at] [this site]&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12334</link><pubDate>Fri, 27 Feb 2009 21:20:36 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12334</guid><dc:creator>Cade Roux</dc:creator><description>&lt;p&gt;You're talking about ContactID in SalesOrderHeader? &amp;nbsp;It turns out there's no variation within CustomerID:&lt;/p&gt;
&lt;p&gt;SELECT CustomerID&lt;/p&gt;
&lt;p&gt;FROM Sales.SalesOrderHeader AS SOH&lt;/p&gt;
&lt;p&gt;GROUP BY CustomerID&lt;/p&gt;
&lt;p&gt;HAVING MIN(ContactID) &amp;lt;&amp;gt; MAX(ContactID)&lt;/p&gt;
&lt;p&gt;but that's probably either a bad DB design or a potential assumption loophole.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12335</link><pubDate>Fri, 27 Feb 2009 21:23:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12335</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;OK, then there is no problem :-)&lt;/p&gt;
&lt;p&gt;Just use the ContactID to get the names, not the CustomerID, and you'll be fine.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12338</link><pubDate>Fri, 27 Feb 2009 21:41:03 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12338</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;Just for comparison, how many seconds and how many reads do your best attempt use?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12339</link><pubDate>Fri, 27 Feb 2009 21:54:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12339</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Peso,&lt;/p&gt;
&lt;p&gt;Part of the challenge is wondering whether you've found the best solution. If post my best and you do worse, you'll know -- and that's not nearly as fun... Plus, I don't want anyone thinking that my best is necessarily THE best and only trying to go that far. So I will share numbers only at the end.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12340</link><pubDate>Fri, 27 Feb 2009 21:57:09 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12340</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;Fair enough.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12366</link><pubDate>Sun, 01 Mar 2009 19:54:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12366</guid><dc:creator>RBArryYoung</dc:creator><description>&lt;p&gt;Hmm, well unless you are intentionally baiting us, you are either really going to like my solution or really, really hate it. :-).&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12379</link><pubDate>Mon, 02 Mar 2009 07:34:12 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12379</guid><dc:creator>Michael Zilberstein</dc:creator><description>&lt;p&gt;You Excel output example is sorted by CustomerID column - it it a requirement?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12383</link><pubDate>Mon, 02 Mar 2009 14:51:35 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12383</guid><dc:creator>Brian Tkatch</dc:creator><description>&lt;p&gt;AdventureWorks: &lt;a rel="nofollow" target="_new" href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004"&gt;http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12384</link><pubDate>Mon, 02 Mar 2009 14:58:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12384</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Michael: No, there is no sorting requirement.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12391</link><pubDate>Mon, 02 Mar 2009 17:29:08 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12391</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;I am looking forward to the presentation of results, together with solutions.&lt;/p&gt;
&lt;p&gt;There are always new things to learn!&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12399</link><pubDate>Tue, 03 Mar 2009 03:14:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12399</guid><dc:creator>RBarryYoung</dc:creator><description>&lt;p&gt;I thought all of you folks would be at the MVP Summit?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12402</link><pubDate>Tue, 03 Mar 2009 10:37:03 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12402</guid><dc:creator>daveballantyne</dc:creator><description>&lt;p&gt;Which Adventure works should we be using ?&lt;/p&gt;
&lt;p&gt;Ive downloaded AdventureWorksDB.msi from the Codeplex site Brian gave&lt;/p&gt;
&lt;p&gt;but ContactID 1 is &amp;nbsp;&amp;quot;Gustavo Achong&amp;quot; not &amp;quot;Orlando Gee&amp;quot;&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12405</link><pubDate>Tue, 03 Mar 2009 12:09:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12405</guid><dc:creator>daveballantyne</dc:creator><description>&lt;p&gt;Also , &amp;nbsp;do we have to use the base schema , or are we allowed to add indexes ?&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12412</link><pubDate>Tue, 03 Mar 2009 15:49:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12412</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Dave:&lt;/p&gt;
&lt;p&gt;No indexes. &amp;nbsp;Check your query and read all of the comments here; you might be joining incorrectly.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12471</link><pubDate>Sun, 08 Mar 2009 19:49:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12471</guid><dc:creator>Mister Magoo</dc:creator><description>&lt;p&gt;Have I got the wrong data or have you prefixed all order numbers with &amp;quot;SO&amp;quot;?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;MM&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12474</link><pubDate>Sun, 08 Mar 2009 21:46:19 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12474</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;I've not prefixed anything. &amp;nbsp;The order numbers are already that way. &amp;nbsp;At least on my end; if yours aren't perhaps you need to reinstall AW before doing this challenge.&lt;/p&gt;
&lt;p&gt;SELECT SalesOrderNumber&lt;/p&gt;
&lt;p&gt;FROM Sales.SalesOrderHeader&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12475</link><pubDate>Mon, 09 Mar 2009 00:16:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12475</guid><dc:creator>Mister Magoo</dc:creator><description>&lt;p&gt;Thanks Adam, I was stupidly using the SalesOrderID...not familiar with AW data..&lt;/p&gt;
&lt;p&gt;Anyway my submission is sent - thanks for a fun challenge.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12554</link><pubDate>Wed, 11 Mar 2009 05:22:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12554</guid><dc:creator>Virgil Rucsandescu</dc:creator><description>&lt;p&gt;This is indeed quite a challenge. I am looking forward to the presentation of solutions.&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12602</link><pubDate>Fri, 13 Mar 2009 12:29:38 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12602</guid><dc:creator>Dan Holmes</dc:creator><description>&lt;p&gt;I and seeing that &amp;quot;Gustavo Achong&amp;quot; is contact 1 too. &amp;nbsp;No join on this one just SELECT ... FROM Person.Contact WHERE ContactID = 1&lt;/p&gt;
&lt;p&gt;I wasn't worried about the difference until i read your response.&lt;/p&gt;
</description></item><item><title>The Grouped String Concatenation Challenge is Closed</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12642</link><pubDate>Mon, 16 Mar 2009 00:41:49 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12642</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Just over two weeks ago I posted the Grouped String Concatenation Challenge . A more difficult challenge&lt;/p&gt;
</description></item><item><title>We need an OLAP function for string concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#12990</link><pubDate>Sun, 29 Mar 2009 18:39:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12990</guid><dc:creator>Alexander Kuznetsov</dc:creator><description>&lt;p&gt;String concatenation in SQL is frequently discussed on newsgroups and blogs. Adam Machanic recently posted&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#13151</link><pubDate>Wed, 08 Apr 2009 07:12:53 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:13151</guid><dc:creator>Peso</dc:creator><description>&lt;p&gt;Out of curiosity I checked out &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/subscriptions/renew.aspx"&gt;http://msdn.microsoft.com/en-us/subscriptions/renew.aspx&lt;/a&gt; and found the only MSDN subscription matching the prize sum was &amp;quot;Visual Studio Team System 2008 Team Suite with MSDN Premium&amp;quot;.&lt;/p&gt;
&lt;p&gt;It's fantastic!&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#13939</link><pubDate>Mon, 11 May 2009 02:48:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:13939</guid><dc:creator>GATTU KUMAR</dc:creator><description>&lt;p&gt; Respected Sir,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Sir presently i am working in onsite as junior database developer.I have been facing problem with Strings Concantenation.Sir i did one example&lt;/p&gt;
&lt;p&gt;in that i am getting error.plese solve this example.&lt;/p&gt;
&lt;p&gt; Example:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Declare @a as varchar(1000)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; set @a='select e.empno,e.firstname'+' ' +'e.lastname as ename,e.salary from emp e'&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; exec (@a)&lt;/p&gt;
&lt;p&gt;Output:incorrect syntax near '.' iam unable to solve this problem&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;plese correct this error.and send url to me the topic about strings Concantenation hopes u to send replay to me&lt;/p&gt;
</description></item><item><title>Grouped String Concatenation: ... The Winner Is ...</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#14361</link><pubDate>Sun, 31 May 2009 20:58:01 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14361</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;After weeks of putting it off, I finally found the time and spent the last day and a half judging the&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#19488</link><pubDate>Thu, 03 Dec 2009 19:15:39 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:19488</guid><dc:creator>JAY</dc:creator><description>&lt;p&gt;WHERE CAN I SEE THE ENTRERED / WINNER'S SOLUTIONS???&lt;/p&gt;
</description></item><item><title>re: T-SQL Challenge: Grouped String Concatenation</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/02/27/t-sql-challenge-grouped-string-concatenation.aspx#34708</link><pubDate>Wed, 06 Apr 2011 16:20:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:34708</guid><dc:creator>Owais Ahmed</dc:creator><description>&lt;p&gt;Very easy challenge for me. Did you not have tough challenges?&lt;/p&gt;
</description></item></channel></rss>