The column transfer function in oracle is "pivot()". The function of this function is to convert rows into columns. The syntax "pivot (any aggregate function for the column name of the value of the special column in (needs to be converted is the value of the column name))".
The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.
The column transfer function in oracle is "pivot()".
pivot function: row to column function
Syntax:
pivot(任一聚合函数 for 需转列的值所在列名 in (需转为列名的值));
Conversion example:
1 , Original table data:
sql statement: select * from T_PIVOT_TEST_1;
select * from T_PIVOT_TEST_1 pivot (sum(er) for th in ('COL_1' as 第一列,'COL_2'as 第二列 ,'COL_3' as 第三列));Result diagram after conversion:
## Recommended tutorial: "
Oracle TutorialThe above is the detailed content of What is the column transfer function in oracle. For more information, please follow other related articles on the PHP Chinese website!