当前位置:网站首页>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
边栏推荐
- Games101 Lesson 9 shading 3 Notes
- Employee attendance management system based on SSM
- [literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
- 2022 P cylinder filling test content and P cylinder filling simulation test questions
- After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
- What are the Bluetooth headsets with good sound quality in 2022? Inventory of four high-quality Bluetooth headsets
- 金仓数据库KingbaseES 插件kdb_date_function
- [set theory] ordered pair (ordered pair | ordered triple | ordered n ancestor)
- Reptile exercise 03
- Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
猜你喜欢

使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found

Preliminary cognition of C language pointer

2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination

Library management system based on SSM

Introduction of pointer variables in function parameters

Jincang KFS data bidirectional synchronization scenario deployment

vulnhub HA: Natraj

Bugku CTF daily question baby_ flag. txt

Introduction to JVM principle

BMZCTF simple_ pop
随机推荐
商城系统搭建完成后需要设置哪些功能
有道云笔记
How to retrieve the password for opening word files
Why should programmers learn microservice architecture if they want to enter a large factory?
Redis persistence principle
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
Leetcode simple question: check whether two string arrays are equal
Number of uniform strings of leetcode simple problem
I've been in software testing for 8 years and worked as a test leader for 3 years. I can also be a programmer if I'm not a professional
Small program animation realizes the running lantern and animation object
多板块轮动策略编写技巧----策略编写学习教材
Php+mysql registration landing page development complete code
stm32逆向入门
Leetcode simple question: check whether the string is an array prefix
FFMpeg example
Pyqt control part (II)
[fairseq] error: typeerror:_ broadcast_ coalesced(): incompatible function arguments
Jincang KFS data bidirectional synchronization scenario deployment
[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
2022-02-12 (338. Bit count)