当前位置:网站首页>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 取出字符;
运行结果
边栏推荐
- Shell_ 01_ data processing
- 字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
- 搭建flutter环境入坑集合
- DS18B20數字溫度計系統設計
- Full record of ByteDance technology newcomer training: a guide to the new growth of school recruitment
- [unsolved] 7-15 shout mountain
- Soft music -js find the number of times that character appears in the string - Feng Hao's blog
- Basic principles of video compression coding and audio compression coding
- 服务器端渲染(SSR)和客户端渲染(CSR)的区别
- 姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
猜你喜欢
原型链继承
字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了
[unsolved]7-14 calculation diagram
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
SQL快速入门
音视频开发面试题
LeetCode 1558. Get the minimum number of function calls of the target array
Hbuilder x format shortcut key settings
汇编语言段定义
随机推荐
Shell_ 07_ Functions and regular expressions
Mongodb在node中的使用
我在字节跳动「修电影」
Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance
7-4 harmonic average
逻辑运算指令
[unsolved] 7-15 shout mountain
Record the error reason
QT system learning series: 1.2 style sheet sub control lookup
LeetCode 1636. Sort the array in ascending order by frequency
Detailed explanation of FLV format
Cartesian tree (modified)
ByteDance new programmer's growth secret: those glittering treasures mentors
@RestController、@Controller
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
LeetCode 1562. Find the latest group of size M
@RequestMapping、@GetMapping
~73 other text styles
JS time function Daquan detailed explanation ----- AHAO blog
When it comes to Google i/o, this is how ByteDance is applied to flutter