ник: Gыwи
Примерно так: (таблица tbl1: code, kp1, kp2, kp3)
select code, kodpok, znpok from
(SELECT tbl1.code, "KP1" AS kodpok, tbl1.KP1 AS znpok
FROM tbl1
union all
SELECT tbl1.code, "KP2" AS kodpok, tbl1.KP2 AS znpok
FROM tbl1
union all
SELECT tbl1.code, "KP3" AS kodpok, tbl1.KP3 AS znpok
FROM tbl1)
order by code, kodpok