Hello,
I need help coming up with the query to pivot [Table1] into [Table2]
[Table1]
LotNumber | Code | Qty | |||||||
---|---|---|---|---|---|---|---|---|---|
5295289 | KX-1.7 | 1 | |||||||
5294679 | AX-1.6 | 1 | |||||||
5294699 | AX-1.1 | 1 | |||||||
5294679 | KX-1.1 | 1 | |||||||
5294701 | AX-1.3 | 1 | |||||||
5294694 | AX-1.3 | 1 | |||||||
5294693 | KX-1.5 | 1 | |||||||
5294696 | AX-1.1 | 1 | |||||||
5294696 | AX-1.1 | 1 | |||||||
5294697 | AX-6.2 | 1 | |||||||
5294697 | AX-1.4 | 1 | |||||||
5295290 | KX-1.2 | 1 | |||||||
[Table2] | |||||||||
Lot Number | AX-1.1 | AX-1.3 | AX-1.4 | AX-1.6 | AX-6.2 | KX-1.1 | KX-1.2 | KX-1.5 | KX-1.7 |
5295289 | 1 | 1 | |||||||
5294679 | 1 | ||||||||
5294699 | 1 | ||||||||
5294701 | 2 | ||||||||
5294694 | 1 | 1 | |||||||
5294693 | 1 | ||||||||
5294696 | 1 | ||||||||
5294697 | 1 | ||||||||
5295290 | 1 |