当前位置:网站首页>MySQL - common functions
MySQL - common functions
2022-06-10 20:27:00 【Xiaobai learns programming together】
Character manipulation
Character interception
left(field,length)
left(col_name, length) function : From left to right .col_name Is the column name ( Mandatory ),length Is the length taken from left to right ( Mandatory As a positive integer , If it is negative, nothing is returned , Subscript from 1 Start , No 0)
right(col_name, length)
right(col_name, length) function : Cut from right to left .col_name Is the column name ( Mandatory ),length Is the length taken from right to left ( must As a positive integer , If it is negative, nothing is returned Subscript from 1 Start , No 0)
substring(col_name, start, length)
substring(col_name, start, length) function : col_name Name ( Mandatory ),start From the first few ( Mandatory Integers from 1 Start ),length Truncated length ( Optional , As a positive integer )
substring_index(col, a, num)
substring_index(col, a, num) function : From num individual a To segment col, When num When it is a positive integer , Split from left to right and take from left to right ;num When is a negative integer , Split from right to left and take from right to left .
summary
1、SUBSTRING_INDEX(subStr, matchStr, index)
Start to intercept the string according to the matching character and the position of occurrence
- subStr: Fields to be intercepted
- matchStr: Matched character
- index: From the first few matching characters , When it is a positive number, search from the left and intercept to the left , When it is negative, search from the right and intercept to the right
2、LEFT(subStr,index)
Cut from the left to the right , As of index position (index from 1 Start )
- subStr: Fields to be intercepted
- index: Where to stop intercepting ( Include characters in this position )
3、RIGHT(subStr,index)
Cut from the right to the left , Up to... From the right index position (index from 1 Start )
- subStr: Fields to be intercepted
- index: Where to stop intercepting ( Include characters in this position )
4、SUBSTRING(subStr, index)
When index When it's negative , Cut from the right to the left , Up to... From the right index position
When index Positive number , Cut from the left to the right , Up to... From the left index position
- subStr: Fields to be intercepted
- index: Where to stop intercepting ( Include characters in this position )
边栏推荐
- First batch! Sinomenine has passed CWPP capability assessment and inspection of Xintong Institute
- 历时2年442位作者132个机构!Google发布语言模型评价新基准BIG-bench,204个任务全面评价语言模型能力,附论文
- Zabbix_监控ssh/crond服务-微信告警
- An error row size too large (& gt; 8126) occurs when MySQL's MyISAM engine switches to InnoDB
- 8.4v dual lithium battery professional charging IC (fs4062a)
- 今年高考期间各考点秩序井然,未发生影响安全的敏感案事件
- Does Seata still not support sqlserver?
- 4.35V锂电充电IC
- SBC芯片35584数据手册预调节器翻译
- Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE tha
猜你喜欢

hidden danger? Limited meaning? Can't stop the real cooking Mini kitchenware hot 618

Rotated sorted array

Spark ShuffleManager

Key points of lldp protocol preparation

性能测试方案(计划)模板

HW blue team intermediate interview reply

京东发布基于张量网络加速的大规模、分布式量子机器学习平台TeD-Q

玩艺术也得学数学?

监控易打造“准生态”格局,赋能信创“平替”

暗黑破坏神不朽数据库怎么用 暗黑破坏神手游不朽数据库使用方法
随机推荐
HM3416H降压IC芯片PWM/PFM 控制 DC-DC 降压转换器
Change the root
FS4521恒压线性充电IC
Open the door of the hybrid cloud market, Lenovo xcloud's way to break the situation
It took 2 years, 442 authors and 132 institutions! Google released the new benchmark big bench for language model evaluation. 204 tasks comprehensively evaluated the language model ability, with paper
功耗开发经验分享:设计功耗大板
补水仪108K加湿器开发方案_单片机_NY8A051F_单片机开发设计开发
ESP8266 系统环境搭建
nodejs: 官方文档3 dgram Stream
During the college entrance examination this year, all examination sites were in good order, and no sensitive cases affecting safety occurred
【录入课本latex记录】
torch.nn.Parameter的简单理解//未完待续,待我看懂这段
PDU session flow
uni-app自定义导航
国庆期间给大家推荐一个可能会成为2019最佳的CRUD工具
FS2117升压IC输出5V2.4A同步整流
FS4100 锂电充电管理IC输入12V给8.4V充电IC
监控易打造“准生态”格局,赋能信创“平替”
Recommend a crud tool that may become the best crud tool in 2019 during the National Day
如何使用物联网低代码平台进行工作表管理?