创建两张测试表
@H_301_2@
sql>createtablet1as 2select'one'asd1,3'two'asd2,4'three'asd3,5'four'asd4,6'five'asd5fromdual; sql>createtablet2(dvarchar2(10),desvarchar2(50);
转置@H_301_2@
sql>insertall 2intot2(d,des)values('一',d1) 3intot2(d,des)values('二',d2) 4intot2(d,des)values('三',d3) 5intot2(d,des)values('四',d4) 6intot2(d,des)values('五',d5) 7selectd1,d2,d3,d4,d5fromt1;
类似@H_301_2@
sql>insertintot2(d,des) 2select'一',d1fromt1unionall 3select'二',d2fromt1unionall 4select'三',d3fromt1unionall 5select'四',d4fromt1unionall 6select'五',d5fromt1;原文链接:https://www.f2er.com/oracle/209107.html