Запрос 1:
select * from(select* from (select Product_ID, batchno, Baleno,
SampleTime, Line, ItemData, ItemType from ItemData) d
pivot(sum(ItemData) for ItemType in (DYL, COLOR, STD)) as piv1) ff
where batchno = '001' AND Product_ID = '1' And Line = 'B'
Запрос 2:
select * from(select* from (select Product_ID, batchno, Baleno, SampleTime,
Line, ItemData, ItemType from ItemData) d
pivot(sum(ItemData) for ItemType in (DYL, COLOR, STD)) as piv1) ff
where batchno = '001' AND Product_ID = '1' And Line = 'A'