zoukankan      html  css  js  c++  java
  • char和varchar2对比

    -- Create table
    create table TLCB_HARDWARE_INFO
    (
      sdate                  DATE,
      ip                     CHAR(20),
      operating_system       VARCHAR2(30),
      operatingsystemrelease CHAR(10),
      hostname               VARCHAR2(40),
      memory_total           CHAR(10),
      swap_total             CHAR(10),
      manufacturer           VARCHAR2(30)
    )
    
    -- Create table
    create table TLCB_MON_DEVICE
    (
      devicename   VARCHAR2(200),
      devicetype   VARCHAR2(200),
      ipaddr       VARCHAR2(200),
      encodetype   VARCHAR2(200),
      descp        VARCHAR2(200),
      sysnameshort VARCHAR2(200),
      dept         VARCHAR2(200),
      hasdeployed  VARCHAR2(200) default 0,
      dpmode       VARCHAR2(30)
    )
    
    select b.descp,a.* from  tlcb_hardware_info a,tlcb_mon_device b
    where trim(a.ip)=b.ipaddr
    
    SQL> select ipaddr,dump(ipaddr) from tlcb_mon_device b where b.ipaddr='10.16.83.2'
      2  ;
     
    IPADDR                                                                           DUMP(IPADDR)
    -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
    10.16.83.2                                                                       Typ=1 Len=10: 49,48,46,49,54,46,56,51,46,50
     
    SQL> select ip,dump(ip) from tlcb_hardware_info b where b.ip='10.16.83.2';
     
    IP                   DUMP(IP)
    -------------------- --------------------------------------------------------------------------------
    10.16.83.2           Typ=96 Len=20: 49,48,46,49,54,46,56,51,46,50,32,32,32,32,32,32,32,32,32,32
    
    chr(32) 空格符
    
    
    SQL> select ip,dump(ip) from tlcb_cron a where a.ip='10.2.231.1';
     
    IP                   DUMP(IP)
    -------------------- --------------------------------------------------------------------------------
    10.2.231.1           Typ=96 Len=20: 49,48,46,50,46,50,51,49,46,49,32,32,32,32,32,32,32,32,32,32
     
     
    SQL> select  ipaddr,dump(ipaddr) from tlcb_mon_device a where a.ipaddr='10.2.231.1';
     
    IPADDR                                                                           DUMP(IPADDR)
    -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
    10.2.231.1                                                                       Typ=1 Len=10: 49,48,46,50,46,50,51,49,46,49
     
    
    

  • 相关阅读:
    case when then else end
    spark读文件写入mysql(scala版本)
    mysql语句
    spark读文件写mysql(java版)
    spark的广播变量
    hive,把一个表中计算好的数据,存到另一个外部表中
    spark操作hive方式(scala)
    spark sql启动优化
    hive on spark (spark2.0.0 hive2.3.3)
    hive优化,开启压缩功能
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349718.html
Copyright © 2011-2022 走看看