MySQL function (ii)

Source: Internet
Author: User
Tags lowercase

1, Space (N) output space

SELECT SPACE (5);

""

2, replace (STR,FROM_STR,TO_STR) said Str in from_str replaced by to_str

SELECT REPLACE (' http://www.baidu.com.cn ', ' Baidu ', ' Google ');

http://www.google.com.cn

3, repeat (str,n) repeat output N times str

SELECT REPEAT (' What ', 2);

Whatwhat

4, reverse () reverse output the contents in parentheses

SELECT REVERSE (123);

321

5. Insert (STR1,POS,LEN,STR2) str1 the position of the POS where the string is inserted, str2 replace the contents of the Pos+len string length

SELECT INSERT (' 123456 ', 3,2, ' haha ');

12haha56

6. ELT (POS,STR1,STR2,STR3.) Print POS Location str

SELECT ELT (4, ' What ', ' ahahaha ', ' haha ', ' ah ');

Ah

7. Field (STR,STR1,STR2,STR3,STR4 ...) output str pos, no case, output null

SELECT FIELD (' ah ', ' What ', ' ahahaha ', ' haha ', ' ah ');

4

8, lower () uppercase to lowercase upper (), UCase () lowercase to uppercase

SELECT LOWER (' ABC ');

abc

SELECT UPPER (' ABC ');

ABC

SELECT UCASE (' ABC ');

ABC

9, Load_file (file_name)

UPDATE table_name
SET blob_column=load_file ("/tmp/picture")
WHERE id=1;

10, Concat (), Group_concat ()

SELECT CONCAT (' Hello ', ' world ');

HelloWorld

MySQL function (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.