当前位置:网站首页>MySQL winter vacation self-study 2022 12 (3)
MySQL winter vacation self-study 2022 12 (3)
2022-07-03 04:35:00 【Crane paper thousand】
-- String function
-- 1, Get the number of string characters
select char_length('hello '); #6 The space is also called
select char_length(' how are you '); #3 Chinese characters count as
-- charactr_length and char_length The same function
-- length Take the length , The units returned are bytes
select length('hello '); #6
select length(' how are you '); #9 UTF-8 In the encoding , Chinese characters take up three bytes
-- 2, String merge
select concat('hello','world','scx');
-- Specify delimiters for string merging
select concat_ws('-','hello','world');
-- 3, Returns the position where the string first appears in the list
select field('aaa','aaa','bbb','ccc'); #1
select field('bbb','aaa','bbb','ccc'); #2
select field('ddd','aaa','bbb','ccc'); #0, Not found
-- 4, Remove the space to the left of the string
select ltrim(' abcd ');
-- Remove the space on the right
select rtrim(' abcd ');
-- Remove the blanks at both ends , The middle string cannot be removed
select trim(' abcd ');
-- 5, String interception
select mid('helloworld',2,3);# Intercept three characters from the second position , The length is 3
-- 6, Get string a In string b Where in , Which one you see first returns which
select position('abc' in 'helloabcworld');#6
select position('abc' in 'habcelloabcworld');#2
-- 7, String substitution , If I have two aaa Replace them all
select replace('helloaaaworld','aaa','bbb');#hellobbbworld
select replace('aaahelloaaaworld','aaa','bbb');#bbbhellobbbworld
-- 8, String inversion
select reverse('hello');#olleh
边栏推荐
- Prefix and (continuously updated)
- Joint set search: merge intervals and ask whether two numbers are in the same set
- Library management system based on SSM
- Bugku CTF daily question baby_ flag. txt
- Joint search set: the number of points in connected blocks (the number of points in a set)
- Dive into deep learning - 2.1 data operation & Exercise
- 2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units
- MC Layer Target
- Mongodb slow query optimization analysis strategy
- Writing skills of multi plate rotation strategy -- strategy writing learning materials
猜你喜欢
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
Games101 Lesson 9 shading 3 Notes
Internationalization and localization, dark mode and dark mode in compose
金仓KFS数据双向同步场景部署
【工具跑SQL盲注】
解决bp中文乱码
Function introduction of member points mall system
[fxcg] market analysis today
Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
随机推荐
金仓数据库KingbaseES 插件kdb_database_link
JVM原理简介
How to use kotlin to improve productivity: kotlin tips
Triangular rasterization
540. Single element in ordered array
MC Layer Target
Crazy scientist
有道云笔记
After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
Number of uniform strings of leetcode simple problem
商城系统搭建完成后需要设置哪些功能
Function introduction of member points mall system
Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.
Factor stock selection scoring model
Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
解决bp中文乱码
关于开学的准备与专业认知
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
金仓数据库KingbaseES 插件kdb_date_function
UiPath实战(08) - 选取器(Selector)