I have data like this:
Product Group Product Level Quatity Sold Trend
==============================================================
Group 1
You can potentially do this using correlated subqueries:
select productGroup as [Product Group]
, (select sum(quantitySold) from myTable where productGroup = a.productGroup and productLevel = 'L1') as L1
, (select max(trend) from myTable where productGroup = a.productGroup and productLevel = 'L1') as L1Trend
, (select sum(quantitySold) from myTable where productGroup = a.productGroup and productLevel = 'L2') as L2
, (select max(trend) from myTable where productGroup = a.productGroup and productLevel = 'L2') as L2Trend
-- etc.
from myTable a
group by productGroup
order by productGroup
Here's an example SqlFiddle.
It may help you to see it this way before you use the PIVOT
keyword.
If you don't know how many productLevel values you have, you'd need a dynamic solution, however.