Вы должны использовать сводку, если хотите преобразовать строки в столбцы на основе одного столбца
( select left(BarCdmID,2) as BarCdmID ,
[0] as AME,
[1] as AMV,
[2] as BHV ,
[3] as BRV,
[4] as EOR ,
[5] as IPA,
[6] as IPB,
[7] as LTC,
[8] as OHW from BARCDM_FACIL) T
pivot
(facility_misfacID
FOR T.BarCdmID
IN [0],[1],[2],[3],[4],[5],[6],[7],[8]
) as pvt