question

itmpofu avatar image
itmpofu asked

Flatten SQL 2016 table

Good help me flatten below table structure, I've tried Sql STUFF and XML path with little success.

KeyAccountProductQtyKA1P1100KA1P2200KA1P3300KA1P4400

to

KeyAccountProduct;Desc;QtyKA1P1;100 | P2;200 | P3;300 | P4;400

Many thanks upfront

Regards










sqltablesql xml
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Please give a table definition, sample data and what you've already attempted. It will help us to help you!

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.