1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. SQL中的單記錄函數(shù)

        時間:2023-03-30 16:12:08 SQL 我要投稿
        • 相關(guān)推薦

        SQL中的單記錄函數(shù)

          SQL中的單記錄函數(shù)

          1.ASCII

          返回與指定的字符對應(yīng)的十進制數(shù);

          SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;

          ;;;;;A A;;;ZERO;;SPACE

          ;;;;65;;;;;97;;;;;48;;;;;32

          2.CHR

          給出整數(shù),返回對應(yīng)的字符;

          SQL> select chr(54740) zhao,chr(65) chr65 from dual;

          ZH C

          趙 A

          3.CONCAT

          連接兩個字符串;

          SQL> select concat('010-','88888888')'轉(zhuǎn)23'; 高乾競電話 from dual;

          高乾競電話

          010-88888888轉(zhuǎn)23

          4.INITCAP

          返回字符串并將字符串的第一個字母變?yōu)榇髮?

          SQL> select initcap('smith') upp from dual;

          UPP

          Smith

          5.INSTR(C1,C2,I,J)

          在一個字符串中搜索指定的字符,返回發(fā)現(xiàn)指定的字符的位置;

          C1;被搜索的字符串

          C2;希望搜索的字符串

          I;;搜索的開始位置,默認為1

          J;;出現(xiàn)的位置,默認為1

          SQL> select instr('Oracle traning','ra',1,2) instring from dual;

          ;INSTRING

          ;;;;;9

          6.LENGTH

          返回字符串的長度;

          SQL> select name,length(name),addr,length(addr),sal,length(to_sal)) from gao.nchar_tst;

          NAMELENGTH(NAME) ADDR;;LENGTH(ADDR);;;;SAL LENGTH(TO_CHAR(SAL))

          高乾競;3 北京市海錠區(qū);;;;;69999.99;7

          7.LOWER

          返回字符串,并將所有的字符小寫

          SQL> select lower('AaBbCcDd')AaBbCcDd from dual;

          AABBCCDD

          aabbccdd

          8.UPPER

          返回字符串,并將所有的字符大寫

          SQL> select upper('AaBbCcDd') upper from dual;

          UPPER

          AABBCCDD

          9.RPAD和LPAD(粘貼字符)

          RPAD; 在列的右邊粘貼字符

          LPAD; 在列的左邊粘貼字符

          SQL> select lpad(rpad('gao',10,'*'),17,'*')from dual;

          LPAD(RPAD('GAO',1

          *******gao*******

          不夠字符則用*來填滿

          10.LTRIM和RTRIM

          LTRIM; 刪除左邊出現(xiàn)的字符串

          RTRIM; 刪除右邊出現(xiàn)的字符串

          SQL> select ltrim(rtrim('gao qian jing',' '),' ') from dual;

          LTRIM(RTRIM('

          gao qian jing

          11.SUBSTR(string,start,count)

          取子字符串,從start開始,取count個

          SQL> select substr('13088888888',3,8) from dual;

          SUBSTR('

          08888888

          12.REPLACE('string','s1','s2')

          string希望被替換的字符或變量

          s1;;;;被替換的字符串

          s2;;;;要替換的字符串

          SQL> select replace('he love you','he','i') from dual;

          REPLACE('H

          i love you

          13.SOUNDEX

          返回一個與給定的字符串讀音相同的字符串

          SQL> create table table1(xm var8));

          SQL> into table1 values('weather');

          SQL> into table1 values('wether');

          SQL> into table1 values('gao');

          SQL> select xm from table1 where soundex(xm)=soundex('weather');

          XM

          weather

          wether

        【SQL中的單記錄函數(shù)】相關(guān)文章:

        excel中if函數(shù)的使用方法09-24

        oracle的sql語句06-18

        SQL優(yōu)化大全08-26

        excel中now函數(shù)的使用方法05-25

        Excel中vlookup函數(shù)使用方法02-17

        怎么打開sql文件06-22

        SQL查詢語句大全09-22

        sql外鍵語句示范06-21

        2017年sql考試試題05-13

        s("download_bottom");

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>