当前位置:网站首页>MySQL built-in functions
MySQL built-in functions
2022-06-13 05:15:00 【strive_ one】
mysql Built in functions in
- String function
- Mathematical functions
- Date time function
- Type conversion function
- Process control
String function
- Look at the ascii Code value ascii(str), str Return when empty string 0
- see ascii The character corresponding to the code value char( Numbers )
- String concatenation concat(str1,str2…)
- Contains the number of characters length(str)
- Intercepting string
- left(str, len) Return string str Left side len Characters
- right(str,len) Return string str Right side len Characters
- substring(str,pos,len) Return string str The location of pos rise len Characters
- left(str, len) Return string str Left side len Characters
- Remove the space
- ltrim(str) Returns the string with the left space removed str
- rtrim(str) Returns the string with the right space removed str
- ltrim(str) Returns the string with the left space removed str
- trim([ Direction remstr from str) Return to delete... From one side remstr String after str, Direction words include both、leading、trailing, On both sides 、 Left 、 Right
- Return from n A string of space characters space(n)
- Replace string replace(str,from_str,to_str)
- toggle case ,lower(str)、upper(str)
Mathematical functions
- Find the absolute value abs(n)
- seek m Divide n The remainder of mod(m,n), Same as operator %
- The floor ( Rounding down )floor(n), No greater than n Maximum integer for
- The ceiling ( Rounding up )ceiling(n), Not less than n Maximum integer for
- To find a rounding value round(n,d),n Means the original number ,d For decimal places , The default is 0
- seek x Of y The next power pow(x,y)
- Get the pi PI()
- random number rand(), The value is 0-1.0 Floating point number
- There are also many trigonometric functions , You can query documents when using
Date time function
- Get child value , Value is positive type , Function as follows :
- year(date) return date A year of ( The scope is 1000 To 9999)
- month(date) return date Month value in
- day(date) return date Date value in
- hour(time) return time The number of hours ( The scope is 0 To 23)
- minute(time) return time Minutes of ( The scope is 0 To 59)
- second(time) return time The number of seconds ( The scope is 0 To 59)
- Date calculation , Use ± Operator , The keyword after the number is year、month、day、hour、minute、second
- Date formatting date_format(date,format)
- Parameters format Optional value :
- %Y Year of acquisition , Return the full year
- %y Year of acquisition , Returns the abbreviated year
- %m Get the month , Return to the month
- %d Acquisition date , Return day value
- %H When getting , return 24 The number of hours in decimal
- %h When getting , return 12 The number of hours in decimal
- %i Get points , Return to minutes
- %s Get seconds , Return seconds
- Parameters format Optional value :
- The current date current_date()
- current time current_time()
- Current date time now()
Small application
md5 encryption
- Be careful : No matter what the length of the characters we want to encrypt , The length after encryption is 32 Bit fixed .md5 Encryption is irreversible ( According to the ciphertext, the plaintext cannot be decrypted )
sha1 encryption
- sha1 The encrypted length is 40 Bit
password() password
边栏推荐
- KVM virtualization management tool
- C language learning log 2.19
- Luogu p1088 Martians
- Bm1z002fj-evk-001 startup evaluation
- Spread your wings and soar
- C language learning log 12.14
- Create a harbor image library from the command line
- Violence enumeration~
- Regular expressions in QT
- Case - random numbers without repetition (HashSet and TreeSet)
猜你喜欢
Luogu p1036 number selection
List collection concurrent modification exception
使用EasyDarwin+FFmpeg实现rtsp推流
KVM virtualization management tool
About anonymous inner classes
Simple SR: best buddy Gans for highly detailed image super resolution
Sampo Lock
Kaggle time series tutorial
Advanced C language - Section 1 - data storage
Case - random numbers without repetition (HashSet and TreeSet)
随机推荐
Building Nacos 2 based on docker compose (using MySQL for persistence)
1.2 differences caused by keywords
C language learning log 11.7
Opencv image storage and reading
C language learning log 1.19
Configuration used by automatic teaching evaluation script
External sort
语音信号分帧的理解
Mysql8.0.13 installation tutorial (with pictures)
Chapter 14 introduction: memory operation API
Ruoyi cloud startup tutorial (hand-held graphics)
Understanding of speech signal framing
metaRTC4.0稳定版发布
[reprint] complete collection of C language memory and character operation functions
行情绘图课程大纲1-基础知识
Simple greedy strategy
Case - the ArrayList collection stores student objects and traverses them in three ways
基于 Docker Compose 搭建 Nacos 2(使用 MySQL 进行持久化)
Std:: Map empty example
Simple SR: best buddy Gans for highly detailed image super resolution