zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    微信公众号对接配置
    ASP.NET MVC5+EF6+EasyUI 后台管理系统(89)-国际化,本地化,多语言应用
    Nacos安装教程
    IDEA 中创建SpringBoot 父子模块
    解决死锁之路(终结篇)
    CentOS安装node和npm
    CentOS安装RabbitMQ
    在LibreOffice中插入代码
    PowerShell查找程序路径
    使用命令行调用控制面板的选项
  • 原文地址:https://www.cnblogs.com/kennyael/p/10027034.html
Copyright © 2011-2022 走看看