Может быть, это поможет:
Данные испытаний:
DECLARE @tbl TABLE
(
ReadTime DATETIME,
Coater VARCHAR(100),
Value FLOAT,
DateType VARCHAR(100)
)
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11A-COATER',1,'FCDAOpside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11A-COATER',1,'FCDABackside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11A-COATER',0,'FCDAOpside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11A-COATER',0.9,'FCDABackside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11B-COATER',1,'FCDAOpside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11B-COATER',2,'FCDABackside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11B-COATER',2.9,'FCDAOpside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:01','PBG11B-COATER',0,'FCDABackside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11A-COATER',1,'FCDAOpside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11A-COATER',1,'FCDABackside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11A-COATER',0,'FCDAOpside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11A-COATER',0.9,'FCDABackside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11B-COATER',1,'FCDAOpside473')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11B-COATER',2,'FCDABackside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11B-COATER',2.9,'FCDAOpside472')
INSERT INTO @tbl VALUES('2012-10-01 13:28:41','PBG11B-COATER',0,'FCDABackside473')
Запрос:
SELECT
*
FROM
(
SELECT
ReadTime,
Coater,
DateType,
Value
FROM @tbl AS tbl
) AS SourceTable
PIVOT
(
MIN(Value)
FOR DateType IN
(
[FCDAOpside472],
[FCDAOpside473],
[FCDABackside472],
[FCDABackside473]
)
)AS PivotTable
ORDER BY
ReadTime