oracle sql语句怎么实现列转行
发布网友
发布时间:2022-04-28 23:52
我来回答
共2个回答
热心网友
时间:2022-04-08 03:37
我能想到的就是union了
select bz a,'BZ' b
from xy_bzrdbap
union
select fbz a,'FBZ' b
from xy_bzrdbap
union
select zzwy a,'ZZWY' b
from xy_bzrdbap
...
热心网友
时间:2022-04-08 04:55
SELECT BZ AS A,'BZ' AS B
FROM xy_bzrdbap
WHERE bjid=362
UNION
SELECT FBZ AS A,'FBZ' AS B
FROM xy_bzrdbap
WHERE bjid=362
UNION
SELECT ZZWY AS A,'ZZWY' AS B
FROM xy_bzrdbap
WHERE bjid=362
...