当前位置:网站首页>MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
2022-06-29 13:47:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
1: String interception
LEFT(guid_,LENGTH(guid_) – 5)//1001-1002-1003 Intercept as 1001-1002
2: Determine whether a string exists
IN(‘1001′,’1002′,’1003’)// where id in(xxxx) You can use a field of the query to directly where id in (select id from xxxx)
3: Repeat according to a certain field
Add to query results COUNT (DISTINCT You want to remove the duplicate according to the field )//select name ,age,sex ,count(distinct name ) from xxx where xxx group by name , age, sex
4: Field splicing
GROUP_CONTACT(name,’:’,sex)//group_contact(‘ Xiao Ming ’,’:’,’ Woman ’)-》“ Xiao Ming : Woman ”
5: Date format
DATE_FORMAT(date,’%Y-%m-%d’)// 20130806 ->2013-08-06
6: Calling stored procedure
CALL xxxxx
7: conditional case when Use
SELECT CASE WHEN sex = 1 THEN “ male ” WHEN sex = 0 THEN “ Woman ” END AS sex
8: Judgment time range
created_at > SUBDATE(NOW(),INTERVAL 24 HOUR) AND created_at < NOW()//24 Within hours
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/132368.html Link to the original text :https://javaforall.cn
边栏推荐
- 记一次 .NET 某物管后台服务 卡死分析
- mysql调优
- Qitai observation: professional elites must step on the huge pit of entrepreneurship - learning effect pit
- 想做个答题类的微信小游戏?读这篇文章就够了
- How to set the safety line and safety margin for futures trading?
- 【毕业季】这四年一路走来都很值得——老学长の忠告
- Cvpr2022 | a convnet for the 2020s & how to design neural network Summary
- 项目管理复习题
- Basic type variable declaration
- Weserver publishing map service
猜你喜欢

揭秘!付费会员制下的那些小心机!

OpenSSL certificate tool user manual

Use Gerrit + Zadig to realize trunk development and trunk publishing (including byte flying Book Practice)

手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学

pdb符号库文件详解

WinDbg common commands

Win32 Tetris (essential for learning MFC)

Ordinary users use vscode to log in to SSH and edit the root file

Three best practices help enterprises improve supply chain security

Deecamp2022 officially opened! Likaifu and zhangyaqin personally teach master courses 𞓜 innovation
随机推荐
存算一体为何是造芯新方向?|对撞派 x 知存科技
Autonomous and controllable city! Release of the first domestic artiq architecture quantum computing measurement and control system
Redis deletion policy and eviction algorithm
[cloud resident co creation] break through the performance bottleneck of image recognition through rust language computing acceleration technology
koa2+better-sqlite3实现增删改查
Qitai observation: professional elites must step on the huge pit of entrepreneurship - learning effect pit
Acwing 234 abandoning testing
Horizon development board configuration network segment
Memorized Function
Rslo: self supervised lidar odometer (real time + high precision, icra2022)
##Mondo Rescue制作镜像文件(有利于镜像损坏恢复)
Cvpr2022 𞓜 future transformer with long-term action expectation
B+树|MYSQL索引使用原则
Netdata data data persistence configuration
高校女生穿旗袍答辩!网友:导师说论文要是和旗袍一样漂亮就好了
The former security director of Uber faced fraud allegations and concealed the data leakage event
Shell judges whether the command is executed successfully
Write a shell script to find the "reverse order" of a number“
C language simulation to realize all character functions
Win32 Tetris (essential for learning MFC)