oracle类似mysql+g_在Oracle SQL * Plus中相当于MySQL的\G

bd96500e110b49cbb3cd949968f18be7.png

In Oracle's SQL*Plus, the results of a SELECT are displayed in a tabular manner. Is there a way to display a row in a key-value manner (like MySQL's \G option)?

The database I am working on (the schema is not defined by me) has a bunch of columns named e.g. YN_ENABLED (YN = yes no) which are CHAR(1). So when I do a query I get a result like

ID_MYTABLE Y Y Y

------------ - - -

3445 Y N Y

So it's not really clear which columns have which values (without having the schema open in another window).

解决方案

Not built in to SQL PLus, but Tom Kyte has provided a procedure called print_table that does this. You would run it like this:

SQL> exec print_table ('select * from mytable where id_mytable=123');

And see results like:

ID_MYTABLE : 123

YN_ENABLED : Y

YN_SOMETHING : N

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值