I have the following set of data which is a result of a query:
╔══════╦══════════╦══════════╦═════════════╦═══════════╦════════════╗
║ Year ║ ItemCode ║ ItemName ║ ItmsGrpNam ║ GroupCode ║ OutQty ║
╠══════╬══════════╬══════════╬═════════════╬═══════════╬════════════╣
║ 2012 ║ 1118 ║ Item 1 ║ Instruments ║ 104 ║ 26.000000 ║
║ 2012 ║ 1118 ║ Item 1 ║ Instruments ║ 100 ║ 264.000000 ║
║ 2012 ║ 1119 ║ Item 2 ║ Instruments ║ 104 ║ 4.000000 ║
║ 2012 ║ 1119 ║ Item 2 ║ Instruments ║ 100 ║ 72.000000 ║
║ 2012 ║ 1120 ║ Item 3 ║ Instruments ║ 104 ║ 4.000000 ║
║ 2012 ║ 1120 ║ Item 3 ║ Instruments ║ 100 ║ 61.000000 ║
║ ... ║ ║ ║ ║ ║ ║
╚══════╩══════════╩══════════╩═════════════╩═══════════╩════════════╝
It shows the quantity of products sold by customer group (GroupCode) and year (Year).
I now want to transform the table to look like this:
╔══════════╦══════════╦═════════════╦═══════════════╦═══════════════╦═══════════════╦═══════════════╗
║ ItemCode ║ ItemName ║ ItmsGrpNam ║ 2012OutQty100 ║ 2012OutQty104 ║ 2013OutQty100 ║ 2013OutQty104 ║
╠══════════╬══════════╬═════════════╬═══════════════╬═══════════════╬═══════════════╬═══════════════╣
║ 1118 ║ Item 1 ║ Instruments ║ 264.000000 ║ 26.000000 ║ 0 ║ 0 ║
║ 1119 ║ Item 2 ║ Instruments ║ 72.000000 ║ 4.000000 ║ 0 ║ 0 ║
║ 1120 ║ Item 3 ║ Instruments ║ 61.000000 ║ 4.000000 ║ 0 ║ 0 ║
║ ... ║ ║ ║ ║ ║ ║ ║
╚══════════╩══════════╩═════════════╩═══════════════╩═══════════════╩═══════════════╩═══════════════╝
So a combination of Year and GroupCode becomes a column and shows the respective OutQty.
I have absolutely no idea how to achieve this with SQL.
Thanks for any help!