Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sridhar3004
Starting Member
34 Posts |
Posted - 2012-02-01 : 10:07:27
|
I've the following dataOrder table OrderNo Item Qty 1 A 4 1 B 3 1 C 2 2 A 2 2 C 2 OrderSize Breakup OrderNo Item Size Qty1 B M 11 B L 11 B XL 11 C XL 22 C L 12 C M 1Please note that not all items will have the size attribute to it. In the above example items B & C have sizes. Hence they are present in the ordersizebreakup table. The output should be in the following format. The items should appear as columns along with their sizesOrderNo A B-S B-M B-L B-XL C-S C-M C-L C-XL1 4 0 1 1 1 0 0 0 22 2 0 0 0 0 0 1 1 0Any help is appreciatedThanks Sridhar |
|
|
|
|