当前位置:网站首页>MySQL interception_ MySQL method for intercepting strings [easy to understand]
MySQL interception_ MySQL method for intercepting strings [easy to understand]
2022-07-01 09:50:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
1、 Intercept the string from the left
left(str, length)
explain :left( Intercepted field , Interception length )
example :select left(content,200) as abstract from my_content_t
2、 Intercept the string from the right
right(str, length)
explain :right( Intercepted field , Interception length )
example :select right(content,200) as abstract from my_content_t
3、 Intercepting string
substring(str, pos)
substring(str, pos, length)
explain :substring( Intercepted field , Starting from the first few )
substring( Intercepted field , Starting from the first few , Interception length )
example :select substring(content,5) as abstract from my_content_t
select substring(content,5,200) as abstract from my_content_t
( notes : If the number of digits is negative Such as -5 It's the last digit , The length to the end of a string or the length to be intercepted )
4、 Intercept string by keyword
substring_index(str,delim,count)
explain :substring_index( Intercepted field , keyword , The number of times keywords appear )
example :select substring_index(”blog.chinabyte.com”,”.”,2) as abstract from my_content_t
result :blog.chinabyte
( notes : If the number of times a keyword appears is negative Such as -2 It's counting backwards , To the end of the string )
result :chinabyte.com
The intercepted string is 15,151,152,16’, It can be seen as ip Well ( Although this does not mean iP),
Then I'm going to intercept the part before each comma
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/131770.html Link to the original text :https://javaforall.cn
边栏推荐
- js重写自己的函数
- HMS core audio editing service 3D audio technology helps create an immersive auditory feast
- IPv6 learning notes
- Ubuntu系统安装与配置MySQL
- HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
- 新数据库时代,不要只学 Oracle、MySQL
- 京东与腾讯续签三年战略合作协议;起薪涨至26万元!韩国三星SK争相加薪留住半导体人才;Firefox 102 发布|极客头条...
- How Kolo enables NFT music industry
- Swag init error: cannot find type definition: response Response
- 数据中台咋就从“小甜甜”变成了“牛夫人”?
猜你喜欢
一个悄然崛起的国产软件,低调又强大!
吃一个女富豪的瓜。。。
Cortex M4 systick details
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
这样理解mmap,挺有意思!
好高的佣金,《新程序员》合伙人计划来袭,人人皆可参与!
遇到女司机业余开滴滴,日入500!
硬件中台项目
2022.02.15_ Daily question leetcode six hundred and ninety
The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious
随机推荐
STM32逆变器电源设计方案,基于STM32F103控制器[通俗易懂]
新数据库时代,不要只学 Oracle、MySQL
Ubuntu系统安装与配置MySQL
Wechat emoticons are written into the judgment, and the OK and bomb you send may become "testimony in court"
Scratch big fish eat small fish Electronic Society graphical programming scratch grade examination level 2 true questions and answers analysis June 2022
那个程序员,被打了。
The "China Mobile Chain" state secret engine was officially launched on BSN
JS rewrite their own functions
In terms of use
High precision factorial
JS use toString to distinguish between object and array
js变量提升(hoisting)
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
奇怪,为什么ArrayList初始化容量大小为10?
JS prototype inheritance can only inherit instances, not constructors
Live broadcast management project
Comparison between Oracle JDK and openjdk
云原生到底是什么?它会是未来发展的趋势吗?
Computer USB, HDMI, DP various interfaces and speeds
Analysis and solution of JS this loss