oracle如何把多列一行的数据转换为一列展示,且转换前的第一列作为转换后的第一行,转换前的第二列作为转换后的第二行,以此类推展示,如:表中数据如下:
Test Name Test Number Lower Limit Upper Limit Units
CONT3 1.1 5 300 mV
展示的结果需要是这样的:
CONT3
1.1
5
300
mV
用union all合并就可以了,如果字段类型不一样,需转换成一致。
select test_name from table
union all select to_char(test_number) from table
union all select to_char(lower_limit) from table