• 字符串处理函数


    SELECT
    SUBSTR('ABCDEFG',3,4),
    SUBSTR('ABCDEFG',3),
    SUBSTR('ABCDEFG',-3,3),
    UPPER('jinhong'),
    lower('X-DEF'),
    REPLACE('JACK and JUE','J','BL'),
    REPLACE('JACK AND LIFE', 'jack'),
    REPLACE('JACK AND LIFE', 'JACK'),
    LENGTH('BLAKE'),
    INSTR('www.life.com.www', 'www.'),
    INSTR('www.life.com.www', 'www',2),
    'ONE'||'TWO'
    
    FROM dual;
    SUBSTR('ABCDEFG',3,4) SUBSTR('ABCDEFG',3) SUBSTR('ABCDEFG',-3,3) UPPER('JINHONG') LOWER('X-DEF') REPLACE('JACKANDJUE','J','BL') REPLACE('JACKANDLIFE','JACK') REPLACE('JACKANDLIFE','JACK') LENGTH('BLAKE') INSTR('WWW.LIFE.COM.WWW','WWW.') INSTR('WWW.LIFE.COM.WWW','WWW',2) 'ONE'||'TWO'
    --------------------- ------------------- ---------------------- ---------------- -------------- ------------------------------ ----------------------------- ----------------------------- --------------- -------------------------------- --------------------------------- ------------
    CDEF                  CDEFG               EFG                    JINHONG          x-def          BLACK and BLUE                 JACK AND LIFE                  AND LIFE                                   5                                1                                14 ONETWO       


    SUBSTR:
    Extracts a portion of a string.
    Syntax:
    SUBSTR(original_string,position[,substring_length])
    It returns a portion of original_string, beginning at
    If position is negative Oracle counts backward from the end of
    The substring_length parameter is optional. If it is omitted, the function returns
    UPPER:
    Returns the string with all letters uppercase.
    Syntax:
    UPPER(original_string)
    LOWER:
    Returns the string with all letters lowercase.
    Syntax:
    LOWER(original_string)
    INITCAP:
    Returns the string with the first letter of each word in uppercase, all other letters in lowercase.
    Syntax:
    INITCAP(original_string)
    REPLACE:
    Returns the string with every occurrence of search_string
    then all occurrences of search_string are removed
    Syntax:
    REPLACE(original_string,search_string,replacement_string)
    LENGTH:
    Returns the length of the string.
    Syntax:
    LENGTH(string)
    INSTR:
    Returns the position in which one string is found within another string.
    Syntax:
    INSTR(main_string,substring[,position[,occurrence]]
     

  • 相关阅读:
    滑动切换界面---多个Activity
    172. Factorial Trailing Zeroes
    152. Maximum Product Subarray
    149. Max Points on a Line
    [转载][c++]用宏(Macro)定义一个函数
    [转载][C++]C++11 左值、右值、右值引用详解
    [转载][c++]C++中指针常量和常量指针的区别
    [转载][C++]类构造函数初始化列表
    22. Generate Parentheses
    328. Odd Even Linked List
  • 原文地址:https://www.cnblogs.com/kakaisgood/p/9566147.html
Copyright © 2020-2023  润新知