当前位置:网站首页>MySQL function
MySQL function
2022-07-24 15:11:00 【ahyo】
– ================ Built in functions ================
– Numerical function
abs(x) – The absolute value abs(-10.9) = 10
format(x, d) – Format the number of thousandths format(1234567.456, 2) = 1,234,567.46
ceil(x) – Rounding up ceil(10.1) = 11
floor(x) – Rounding down floor (10.1) = 10
round(x) – Round to the nearest whole
mod(m, n) – m%n m mod n Seeking remainder 10%3=1
pi() – Get the pi
pow(m, n) – m^n
sqrt(x) – Arithmetical square root
rand() – random number
truncate(x, d) – Intercept d Decimal place
– Time date function
now(), current_timestamp(); – Current date time
current_date(); – The current date
current_time(); – current time
date(‘yyyy-mm-dd hh:ii:ss’); – Get the date part
time(‘yyyy-mm-dd hh:ii:ss’); – Get the time part
date_format(‘yyyy-mm-dd hh:ii:ss’, ‘%d %y %a %d %m %b %j’); – Format time
unix_timestamp(); – get unix Time stamp
from_unixtime(); – Get the time from the time stamp
– String function
length(string) – string length , byte
char_length(string) – string Characters of
substring(str, position [,length]) – from str Of position Start , take length Characters
replace(str ,search_str ,replace_str) – stay str of use replace_str Replace search_str
instr(string ,substring) – return substring First time in string Where in
concat(string [,…]) – Connection string
charset(str) – Returns the string character set
lcase(string) – Convert to lowercase
left(string, length) – from string2 From the left side of length Characters
load_file(file_name) – Read from file
locate(substring, string [,start_position]) – Same as instr, But you can specify the starting position
lpad(string, length, pad) – Repeat pad Add to string start , Until the string length is length
ltrim(string) – Remove the front space
repeat(string, count) – repeat count Time
rpad(string, length, pad) -- stay str After use pad Add , Until the length is length
rtrim(string) – Remove back-end space
strcmp(string1 ,string2) – Compare the size of two strings character by character
– Aggregate functions
count()
sum();
max();
min();
avg();
group_concat()
– Other common functions
md5();
default();
边栏推荐
- Various searches (⊙▽⊙) consolidate the chapter of promotion
- The vs compiled application is missing DLL
- 股票开户之后就可以购买6%的理财产品了?
- Leetcode-09 (next rank + happy number + full rank)
- (09) flask is OK if it has hands - cookies and sessions
- 【USENIX ATC'22】支持异构GPU集群的超大规模模型的高效的分布式训练框架Whale
- dataframe 分组后排序的前n行 nlargest argmax idmax tail !!!!
- Spark: get the access volume of each time period in the log (entry level - simple implementation)
- pytorch with torch.no_grad
- MongoDB入门学习
猜你喜欢

spark学习笔记(三)——sparkcore基础知识

27. Directory and file system

Explain the edge cloud in simple terms | 2. architecture

Spark: get the access volume of each time period in the log (entry level - simple implementation)

Meaning of 7 parameters of thread pool

Outlook tutorial, how to set rules in outlook?
![Property datasource is required exception handling [idea]](/img/f3/50d36ed9445695c02e2bd622109d66.png)
Property datasource is required exception handling [idea]

Leetcode high frequency question 56. merge intervals, merge overlapping intervals into one interval, including all intervals

Kali concise language transformation method (illustration)

The server switches between different CONDA environments and views various user processes
随机推荐
Is it safe for Huatai Securities to open an account? Can it be handled on the mobile phone?
The first n rows sorted after dataframe grouping nlargest argmax idmax tail!!!!
Class loading mechanism and parental delegation mechanism
Activate the newly installed Anaconda in the server
Date class and time class definitions (operator overload application)
华为无线设备配置WPA2-802.1X-AES安全策略
Isprs2018/ cloud detection: cloud/shadow detection based on spectral indexes for multi/hyp multi / hyperspectral optical remote sensing imager cloud / shadow detection
Problems needing attention in mobile terminal testing
Summary of Baimian machine learning
String application - calculate the longest true prefix of a string
Chiitoitsu
26. Code implementation of file using disk
Extjs4 instance address and Chinese document address
mysql
TS learning record (I) sudo forgets the password (oolong) try changing the 'lib' compiler option to include 'DOM'
JSON file editor
【OpenCV 例程300篇】238. OpenCV 中的 Harris 角点检测
How do novices buy stocks for the first time? Which securities company is the best and safest to open an account
Differences between C language pointer and array A and &a, &a[0], etc
Detailed explanation of document operation