当前位置:网站首页>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 取出字符;
运行结果
边栏推荐
- Error occurred during initialization of VM Could not reserve enough space for object heap
- [unsolved]7-14 calculation diagram
- 搭建flutter环境入坑集合
- redux使用说明
- Basic principles of video compression coding and audio compression coding
- LeetCode 1637. The widest vertical area between two points without any point
- After the subscript is used to assign a value to the string type, the cout output variable is empty.
- 字节跳动开源GAN模型压缩框架,算力最高节省97.8%丨ICCV 2021
- When it comes to Google i/o, this is how ByteDance is applied to flutter
- Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
猜你喜欢
The 116 students spent three days reproducing the ByteDance internal real technology project
redux使用说明
Which is more important for programming, practice or theory [there are some things recently, I don't have time to write an article, so I'll post an article on hydrology, and I'll fill in later]
Native JS realizes the functions of all selection and inverse selection -- Feng Hao's blog
Solr new core
我走過最迷的路,是字節跳動程序員的腦回路
Two weeks' experience of intermediate software designer in the crash soft exam
数据传送指令
When it comes to Google i/o, this is how ByteDance is applied to flutter
~87 animation
随机推荐
LeetCode 1641. Count the number of Lexicographic vowel strings
Record the error reason: terminate called after throwing an instance
Shell_ 00_ First meeting shell
JS time function Daquan detailed explanation ----- AHAO blog
~77 linear gradient
Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.
Some instructions on whether to call destructor when QT window closes and application stops
Cmake Express
Restful style interface design
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
~82 style of table
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
Cmake error: could not create named generator visual studio 16 2019 solution
DOS 功能调用
逻辑运算指令
这116名学生,用3天时间复刻了字节跳动内部真实技术项目
Eureka high availability
亮相Google I/O,字节跳动是这样应用Flutter的
@RestController、@Controller