在 oracle 中垂直显示结果

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2228680/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 19:59:11  来源:igfitidea点击:

displaying results vertically in oracle

oracle

提问by garageàtrois

I'm enamored with mysql's \G feature which I find very useful when SELECTing from tables with many columns. Is there a similar feature in oracle which displays each column on its own line? How do people normally deal with this issue?

我很喜欢 mysql 的 \G 功能,我发现它在从具有多列的表中进行 SELECT 时非常有用。oracle 中是否有类似的功能将每一列显示在自己的行上?人们通常如何处理这个问题?

回答by Tony Andrews

I use Tom Kyte's print_table procedure

我使用Tom Kyte 的 print_table 程序

For example:

例如:

SQL> exec print_table('select * from emp where empno=7839')
EMPNO                         : 7839
ENAME                         : KING
JOB                           : PRESIDENT
MGR                           :
HIREDATE                      : 17-nov-1981 00:00:00
SAL                           : 100
COMM                          : 500
DEPTNO                        : 10
-----------------

PL/SQL procedure successfully completed.