当前位置:网站首页>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
边栏推荐
- Don't build the wheel again. It is recommended to use Google guava open source tool class library. It is really powerful!
- [graduation season · advanced technology Er] 10.76 million graduates, the most difficult employment season in history? I can't roll it up again. I lie down again and again. Where is the road?
- How can the sports app keep the end-to-side background alive to make the sports record more complete?
- Hundreds of CVPR people were recruited as new champions. Emoji became a "court witness". M2 MBP was exposed that the hard disk speed was reduced. Today, more big news is here
- Lecun published a research plan for the next decade: AI autonomous intelligence with a 62 page paper
- 基于51单片机控制的BUCK开关电源Proteus仿真
- C语言的指针详解
- 【无标题】安装依赖报错:Refusing to install package with name “***“ under a package
- Review questions of project management
- Leetcode 179 Maximum number (2022.06.28)
猜你喜欢

DeeCamp2022正式开营!李开复、张亚勤亲授大师课 | 创新事

Cvpr2022 𞓜 future transformer with long-term action expectation

Deecamp2022 officially opened! Likaifu and zhangyaqin personally teach master courses 𞓜 innovation

Autonomous and controllable city! Release of the first domestic artiq architecture quantum computing measurement and control system

Koa2+better-sqlite3 to add, delete, change and query

Getting started with SQLite3

Technology sharing | broadcast function design in integrated dispatching

Don't build the wheel again. It is recommended to use Google guava open source tool class library. It is really powerful!

Appkey when applying for offline packaging of uniapp

C language character function
随机推荐
项目管理复习题
[cloud resident co creation] industrial wisdom "brain", a new acceleration script for old factories
C语言字符函数
*打卡算法*LeetCode 146. LRU 缓存 算法解析
C language simulation to realize all character functions
Win32 Tetris (essential for learning MFC)
【系统设计】邻近服务
Basic type variable declaration
Mondo rescue creates an image file (which is conducive to image damage recovery)
Create an API rapid development platform, awesome!
Online text filter less than specified length tool
What is the reason why the gbase8s database encountered a 951 error?
打造一个 API 快速开发平台,牛逼!
Memorized Function
MySQL常用语句和命令汇总
Openssl证书工具使用手册
CVPR上百人中招新冠,emoji成“呈堂证供”,M2 MBP被曝硬盘降速,今日更多大新闻在此...
成功解决NotImplementedError: numpy() is only available when eager execution is enabled.
极光 · 哈夫曼树の生成(线段树结构 非指针)(仿邻接表)
Ordinary users use vscode to log in to SSH and edit the root file