当前位置:网站首页>MySQL字符串函数
MySQL字符串函数
2022-07-06 09:30:00 【My71】
转 ASCII 码
函数:ASCII(字符串)
指令
SELECT ASCII("A") AS ASCII码;
运行结果
统计字符串长度
函数:CHAR_LENGTH(字符串)
指令
SELECT CHAR_LENGTH("abcde") AS 字符串长度;
运行结果
合并字符串
函数:CONCAT(s1,s2…sn)
指令
SELECT CONCAT("My","SQL") AS 合并字符串;
运行结果
返回字符串的位置
函数:FIELD(s,s1,s2…)
说明:返回值为字符串 s 在 s1,s2… 列表中的位置,起始位置为 1
指令
SELECT FIELD("a","b","c","a","d") AS 查找字符a;
运行结果
字符转小写
函数:LCASE(字符串)
指令
SELECT LCASE("aBcDeF") AS 转小写;
运行结果
字符转大写
函数:UCASE(字符串)
指令
SELECT UCASE("aBcDeF") AS 转大写;
运行结果
取出前 n 个字符
函数:LEFT(字符串,位置)
指令
SELECT LEFT("aBcDeF",3) AS 取出字符;
运行结果
边栏推荐
- One hundred questions of image processing (1-10)
- LeetCode 1558. Get the minimum number of function calls of the target array
- Cartesian tree (modified)
- Tencent interview algorithm question
- How to configure hosts when setting up Eureka
- 7-6 sum of combinatorial numbers
- The 116 students spent three days reproducing the ByteDance internal real technology project
- LeetCode1556. Thousand separated number
- GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
- LeetCode 1551. Minimum operand to make all elements in the array equal
猜你喜欢
姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
Soft music -js find the number of times that character appears in the string - Feng Hao's blog
字节跳动新程序员成长秘诀:那些闪闪发光的宝藏mentor们
ByteDance technical Interviewer: what kind of candidate do I want to pick most
Shell_ 07_ Functions and regular expressions
The 116 students spent three days reproducing the ByteDance internal real technology project
LeetCode 1560. The sector with the most passes on the circular track
Usage of insert() in vector
~Introduction to form 80
Two weeks' experience of intermediate software designer in the crash soft exam
随机推荐
js垃圾回收机制和内存泄漏
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
~86m rabbit practice
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
One hundred questions of image processing (11-20)
「博士毕业一年,我拿下 ACL Best Paper」
LeetCode 1560. The sector with the most passes on the circular track
~78 radial gradient
was unable to send heartbeat
Native JS realizes the functions of all selection and inverse selection -- Feng Hao's blog
ByteDance open source Gan model compression framework, saving up to 97.8% of computing power - iccv 2021
Codeforces Round #771 (Div. 2)
The 116 students spent three days reproducing the ByteDance internal real technology project
腾讯面试算法题
字节跳动技术面试官现身说法:我最想pick什么样的候选人
~79 Movie card exercise
"One year after graduation, I won ACL best paper"
SQL quick start
亮相Google I/O,字节跳动是这样应用Flutter的
搭建flutter环境入坑集合