• SQL------COLUMN命令


    转载自:https://www.cnblogs.com/linjiqin/archive/2013/06/24/3152484.html

    sqlplus column命令用法

    column是sqlplus里最实用的一个命令,很多时候sql语句输出的列宽度不合适而影响查看,都需要用到这个命令来更改select语句中指定列的宽度和标题。大部分时候,我们可以简写column为col即可,主要有以下用法:

    a)、修改列宽度 col c1 format a20 –将列c1(字符型)显示最大宽度调整为20个字符 col c1 format 9999999 –将列c1(number型)显示最大宽度调整为7个字符

    b)、修改列标题 col c1 heading c2 –将c1的列名输出为c2

    c)、设置列的对齐方式 SQL> col ename justify left/right/center; SQL> select empno, ename, job from emp; 注意:对于number类型的数据默认为右对齐,其他默认为左对齐

    d)、隐藏某列显示:col job noprint SQL> col job noprint; SQL> select empno, ename, job from emp;

    e)、格式化number类型列的显示:column sal format $999,999.00 SQL> column sal format $999,999.00 SQL> select empno, ename, sal from emp; e)、设置列值,若列植为空以text代替 SQL> col comm null text SQL> select * from emp;

    f)、显示列的当前属性 SQL> column ename;

    g)、重置为默认值: SQL> clear columns;

    h)、一行只显示数字位的长度, 超过长度折行, 加word_wrapped后, 单词不会折行 column info format a40 word_wrapped

    i)、cle[ar]: 清除掉所有的列格式

    j)、设置列头 sql> column ename heading '姓名' format a15

  • 相关阅读:
    too many open files linux服务器 golang java
    fasthttp 文档手册
    syncer.go
    grpc.go
    stm.go
    session.go
    mutex.go
    [HTML5]label标签使用以及建议
    禁止使用finalize方法
    [支付宝]手机网站支付快速接入
  • 原文地址:https://www.cnblogs.com/kennyael/p/10027034.html
Copyright © 2020-2023  润新知