当前位置:网站首页>MySQL string function

MySQL string function

2022-07-06 17:01:00 My71

turn ASCII code

  1. function :ASCII( character string )

  2. Instructions

    SELECT ASCII("A") AS ASCII code ;
    
  3. Running results

Statistical string length

  1. function :CHAR_LENGTH( character string )

  2. Instructions

    SELECT CHAR_LENGTH("abcde") AS  String length ;
    
  3. Running results

Merge strings

  1. function :CONCAT(s1,s2…sn)

  2. Instructions

    SELECT CONCAT("My","SQL") AS  Merge strings ;
    
  3. Running results

Returns the position of the string

  1. function :FIELD(s,s1,s2…)

  2. explain : The return value is a string s stay s1,s2… Position in the list , The starting position is 1

  3. Instructions

    SELECT FIELD("a","b","c","a","d") AS  To find the character a;
    
  4. Running results

Character to lowercase

  1. function :LCASE( character string )

  2. Instructions

    SELECT LCASE("aBcDeF") AS  Turn lowercase ;
    
  3. Running results

Capitalize characters

  1. function :UCASE( character string )

  2. Instructions

    SELECT UCASE("aBcDeF") AS  Turn capitalization ;
    
  3. Running results

Before removal n Characters

  1. function :LEFT( character string , Location )

  2. Instructions

    SELECT LEFT("aBcDeF",3) AS  Take out the characters ;
    
  3. Running results

原网站

版权声明
本文为[My71]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060922439808.html