17,089
社区成员
发帖
与我相关
我的任务
分享
-- UNPIVOT
SQL>
SQL> create table test(id1 int, id2 int, id3 int, id4 int);
Table created
SQL> insert into test values(100, 200, 400, 600);
1 row inserted
SQL> insert into test values(200, 300, 600, 800);
1 row inserted
SQL> select distinct cc from test
2 unpivot(cc for xx in (id1, id2, id3, id4)) x;
CC
---------------------------------------
100
400
600
300
200
800
6 rows selected
SQL> drop table test;
Table dropped
SQL>