当前位置:网站首页>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
边栏推荐
- Function introduction of member points mall system
- 2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
- 跨境电商多商户系统怎么选
- Prefix and (continuously updated)
- [set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
- 解决bp中文乱码
- How do you use lodash linking function- How do you chain functions using lodash?
- Truncated sentences of leetcode simple questions
- 重绘和回流
- After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
猜你喜欢
[nlp] - brief introduction to the latest work of spark neural network
MC Layer Target
Basic use of continuous integration server Jenkins
After reviewing MySQL for a month, I was stunned when the interviewer of Alibaba asked me
The simple problem of leetcode: dismantling bombs
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
Employee attendance management system based on SSM
Php+mysql registration landing page development complete code
Bugku CTF daily question baby_ flag. txt
Introduction of pointer variables in function parameters
随机推荐
Joint search set: the number of points in connected blocks (the number of points in a set)
Games101 Lesson 9 shading 3 Notes
2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
[BMZCTF-pwn] 20-secret_ file
Human resource management system based on JSP
After reviewing MySQL for a month, I was stunned when the interviewer of Alibaba asked me
金仓数据库KingbaseES 插件kdb_exists_expand
Square root of X
General undergraduate college life pit avoidance Guide
Php+mysql registration landing page development complete code
[set theory] set identities (idempotent law | exchange law | combination law | distribution rate | De Morgan law | absorption rate | zero law | identity | exclusion law | contradiction law | complemen
[set theory] binary relation (example of binary relation on a | binary relation on a)
使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
金仓数据库KingbaseES 插件kdb_database_link
Hj35 serpentine matrix
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
Library management system based on SSM
2022-02-13 (347. Top k high frequency elements)
Number of uniform strings of leetcode simple problem