So here is the table I get from a query:
----------+----+-----------+----------------------
45678-sm-w| 18 |T-Shirts | Mens clothing
----------+----+-----------+----------------------
45678-sm-b| 5 |T-Shirts | Mens clothing
----------+----+-----------+----------------------
2189-L-Wh | 4 | Socks | Juniors Clothing
----------+----+-----------+----------------------
2189-L-Bl | 3 | Socks | Juniors Clothing
----------+----+-----+-----+----------------------
I want to put into a report the looks like:
T-Shirts
----------+----+-----------+----------------------
45678-sm-w| 18 |T-Shirts | Mens clothing
----------+----+-----------+----------------------
45678-sm-b| 5 |T-Shirts | Mens clothing
----------+----+-----------+----------------------
Socks
----------+----+-----------+----------------------
2189-L-Wh | 4 | Socks | Juniors Clothing
----------+----+-----------+----------------------
2189-L-Bl | 3 | Socks | Juniors Clothing
----------+----+-----+-----+----------------------
I know it is done through a loop but cannot figure it out. Thanks!