I have a table with any number of duplicates in the brand column, with a limited number of options in the size column:
Item Brand Size
1 BiGNRG AA
2 LongLife AAA
3 LongLife AAA
4 BiGNRG AA
5 LongLife D
6 EcoBatt C
7 BiGNRG AAA
8 BiGNRG AA
9 EcoBatt C
I need an SQL query to convert that information to this:
Brand AA AAA C D
BiGNRG 3 1 0 0
EcoBatt 0 0 2 0
LongLife 0 2 0 1
I cannot figure out how to convert this data into this format.