То, что вы ищете, - это UNPIVOT. unpivot-example
DROP TABLE IF EXISTS yourTable;
CREATE TABLE yourTable (
COL_01 INT NULL
, COL_02 INT NULL
, COL_03 INT NULL
, COL_04 INT NULL
, COL_05 INT NULL
, COL_06 INT NULL
, COL_07 INT NULL
, COL_08 INT NULL
, COL_09 INT NULL
, COL_10 INT NULL
, COL_11 INT NULL
, COL_12 INT NULL
, COL_13 INT NULL
, COL_14 INT NULL
, COL_15 INT NULL
) ;
GO
INSERT INTO dbo.yourTable (COL_01
, COL_02
, COL_03
, COL_04
, COL_05
, COL_06
, COL_07
, COL_08
, COL_09
, COL_10
, COL_11
, COL_12
, COL_13
, COL_14
, COL_15
)
VALUES (
CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
,CAST ((RAND()*100) AS INT)
) ;
GO 20
SELECT TOP (100) * FROM dbo.yourTable
Unpivot Code
SELECT
unpvt.ColumnName
, MAX( ColumnValue )
, MIN( ColumnValue )
, AVG( ColumnValue )
FROM (
SELECT
COL_01
, COL_02
, COL_03
, COL_04
, COL_05
, COL_06
, COL_07
, COL_08
, COL_09
, COL_10
, COL_11
, COL_12
, COL_13
, COL_14
, COL_15
FROM dbo.yourTable
) p
UNPIVOT (
ColumnValue
FOR ColumnName IN (COL_01, COL_02, COL_03, COL_04, COL_05, COL_06, COL_07, COL_08, COL_09, COL_10, COL_11
, COL_12, COL_13, COL_14, COL_15
)
) AS unpvt
GROUP BY unpvt.ColumnName ;