当前位置:网站首页>MySQL common functions
MySQL common functions
2022-06-28 05:59:00 【Coder without code】
Be careful : The function in this article contains Chinese characters , Don't copy , Type it yourself .
1. Maximum :max
2. Round function :
round(x): Returns the closest parameter x The integer value . for example round(3.14) return 3.
round(x,y):x For input parameters ,y To reserve decimal places .y Keep to ten digits when it is negative , Bits are 0.round(123.23)
3. The average :avg
4. The absolute value :abs( Value data );
5. Substitution function :replace('abcdefg','abc','aaa'); The string ’abcdefg‘ Medium abc Replace with ’aaa'.
6.right(str,length),left(str,length), Intercept the right / The string on the left .
substring(str,pos) From pos Start intercepting a string , Until the end
substring(str,pos,length) From pos Start intercepting a string , Intercept length Characters .(pos When it's negative , It's the last to start intercepting ).
7. String connection :concat('sss','aaa') take sss Same as aaa Connect . There are null When to return to null.
concat_ws(‘,’,‘aaa’,'sss'). The first string is the delimiter , The result is ‘aaa,sss’.
8. To string :
cast('132' as signed) CONVERT('123',SIGNED); To int.
Available types
Binary system , Syntaxis binary The effect of prefixes : BINARYCharacter , With parameters : CHAR()
date : DATE
Time : TIME
Date time type : DATETIME
Floating point numbers : DECIMAL
Integers : SIGNED
Unsigned integer : UNSIGNED
边栏推荐
猜你喜欢

How the third-party libraries in cocoapod reference local header files

The windows environment redis uses AOF persistence and cannot generate an AOF file. After generation, the content of the AOF file cannot be loaded

YYGH-BUG-03

pytorch详解

深度學習19種損失函數

Xcode13.3.1 error reported after pod install

What is the e-commerce conversion rate so abstract?

Drop down box for implementation

Small ball playing

YYGH-BUG-02
随机推荐
What is webrtc?
Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application
数据仓库:分层设计详解
pytorch详解
[MySQL] all query tables contain 20million data -- how to optimize SQL
[C language practice - printing hollow square and its deformation]
ipvs 导致syn 重传问题
lombok @EqualsAndHashCode 注解如何让对象.equals()方法只比较部分属性
高质量国产立体声编解码器CJC8988,Pin to Pin替代WM8988
idea创建类时自动添加注释
Global country (and region) information JSON data
What is the e-commerce conversion rate so abstract?
Independent station sellers are using the five e-mail marketing skills, do you know?
马赛克数据增强 mosaic
pytorch dataloader的长度 epoch与iteration的区别
Enum
Object对象转 List集合
重载,重写的区别,抽象类,接口的区别
PKG package node project (express)
Ethereum Classic的难度计算|猿创征文