当前位置:网站首页>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();
边栏推荐
- spark:指定日期输出相应日期的日志(入门级-简单实现)
- Unity uses NVIDIA flex for unity plug-in to realize the effects of making software, water, fluid, cloth, etc. learning tutorial
- pip换源
- Data analysis and mining 2
- Conversion of timestamp and time in Excel
- Jmeter-调用上传文件或图片接口
- 野火stm32霸道,通过固件库实现流水灯
- Outlook tutorial, how to create tasks and to DOS in outlook?
- Unity 使用NVIDIA FleX for Unity插件实现制作软体、水流流体、布料等效果学习教程
- Learning and thinking about the relevant knowledge in the direction of building network security knowledge base
猜你喜欢

Class loading mechanism and parental delegation mechanism

How to set packet capturing mobile terminal

onBlur和onChange冲突解决方法

Vector introduction and underlying principle

Discussion and legitimacy of the order of entering and leaving the stack
![[matlab] matlab drawing Series II 1. Cell and array conversion 2. Attribute cell 3. delete Nan value 4. Merge multiple figs into the same Fig 5. Merge multiple figs into the same axes](/img/4d/b0ba599a732d1390c5eeb1aea6e83c.png)
[matlab] matlab drawing Series II 1. Cell and array conversion 2. Attribute cell 3. delete Nan value 4. Merge multiple figs into the same Fig 5. Merge multiple figs into the same axes

Kali concise language transformation method (illustration)

AG. DS binary tree -- hierarchical traversal

《Route planning method for UAV in unknown environment based on improved SAS algorithm》翻译

DS binary tree - maximum distance of binary tree nodes
随机推荐
zabbix管理员忘记登录密码
27. Directory and file system
老虎口瀑布:铜梁版小壶口瀑布
DDD based on ABP -- Entity creation and update
Problem handling of repeated restart during Siemens botu installation
Jmeter-调用上传文件或图片接口
【OpenCV 例程300篇】238. OpenCV 中的 Harris 角点检测
Strongly connected component
Time series of machine learning
新手第一次怎么买股票 哪家证券公司开户最好最安全
Similarities and differences between nor flash and NAND flash
Date class and time class definitions (operator overload application)
Explain the edge cloud in simple terms | 2. architecture
C# 无操作则退出登陆
Mysql库的操作
Here comes the problem! Unplug the network cable for a few seconds and plug it back in. Does the original TCP connection still exist?
Which securities company is good at opening an account with flush? Excuse me, is it safe to open an account with mobile phone or stock?
Grpc middleware implements grpc call retry
How to set packet capturing mobile terminal
MySQL build master-slave synchronization - build with docker