当前位置:网站首页>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 取出字符;运行结果

边栏推荐
- LeetCode 1637. The widest vertical area between two points without any point
- ~70 row high
- CMake速成
- ~85 transition
- LeetCode 1552. Magnetic force between two balls
- LeetCode 1561. The maximum number of coins you can get
- Detailed explanation of FLV format
- LeetCode 1984. Minimum difference in student scores
- Record the error reason
- Shell_ 06_ Judgment and circulation
猜你喜欢

~84 form supplement

搭建flutter环境入坑集合

这群程序员中的「广告狂人」,把抖音广告做成了AR游戏

ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues

字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了

Solr new core

Ffmpeg command line use

Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.

原型链继承

我在字节跳动「修电影」
随机推荐
~78 radial gradient
字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
ByteDance technical Interviewer: what kind of candidate do I want to pick most
Error: case label `15 'not within a switch statement
LeetCode 1561. The maximum number of coins you can get
~71 abbreviation attribute of font
服务器端渲染(SSR)和客户端渲染(CSR)的区别
LeetCode 1020. Number of enclaves
The most lost road I have ever walked through is the brain circuit of ByteDance programmers
Restful style interface design
7-10 punch in strategy
Basic principles of video compression coding and audio compression coding
JS time function Daquan detailed explanation ----- AHAO blog
Data config problem: the reference to entity 'useunicode' must end with ';' delimiter.
DS18B20数字温度计系统设计
7-6 sum of combinatorial numbers
Redis standalone startup
~70 row high
音视频开发面试题
~75 background