January 27, 2014 at 6:59 am
Hi all,
Hope you can help.. Im trying to group data using TSQL below is what I have so far
Store No_Transaction No_Line No_POS Terminal No_Item No_ Variant CodeProduct Group CodeQuantityDiscountTotalRounded
34 3967 10000P03402 405932 114 WC0302 1032
34 3967 20000P03402 402970 112 WA0408 105
34 3967 30000P03402 407554 108 WC1101 105
what I want to do is get the result set something like below
Store No_Transaction No_POS Terminal No_Item No_ Variant CodeProduct Group Code QuantityDiscountTotalRounded
34 3967 P03402 405932, 402970, 407554 114,112,108 WC0302, WA0408, WC1101 3 0 37
Any help would be muc appreciated
January 27, 2014 at 7:26 am
Not really sure why you want to take nicely normalized information and smash it all together but this is actually fairly easy to do. Please see this article that explains exactly how to do this kind of thing.
http://www.sqlservercentral.com/articles/71700/[/url]
_______________________________________________________________
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/
January 27, 2014 at 7:44 am
Thanks alot Really appreciate it
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply