当前位置:网站首页>MySQL common functions
MySQL common functions
2022-07-24 12:08:00 【carroll18】
List of articles
Number function
| The name of the function | do use |
|---|---|
| ABS | Find the absolute value |
| SQRT | Find the quadratic root |
| MOD | Mod |
| CEIL and CEILING | The two functions have the same function , All return the minimum integer no less than the parameter , That is, round up |
| FLOOR | Rounding down , The return value is converted to a BIGINT |
| RAND | Generate a 0~1 Random number between , The input integer parameter is , Used to generate repeat sequences |
| ROUND | Round the parameters passed |
| SIGN | Returns the symbol of the parameter |
| POW and POWER | The functions of the two functions are the same , Are the result values of the power of the passed parameters |
| SIN | Find the sine |
| ASIN | Find the inverse sine , And functions SIN They're inverse functions to each other |
| COS | Find the cosine |
| ACOS | Find the inverse cosine , And functions COS They're inverse functions to each other |
| TAN | Find tangent |
| ATAN | Find the arctangent , And functions TAN They're inverse functions to each other |
| COT | Find the cotangent value |
String function
| The name of the function | do use |
|---|---|
| LENGTH | Evaluate string length function , Returns the byte length of the string |
| CONCAT | Merge string functions , The return result is the string generated by the connection parameter , Parameters can make one or more |
| INSERT | Replace string functions |
| LOWER | Convert the letters in the string to lowercase |
| UPPER | Convert the letters in the string to uppercase |
| LEFT | Take the string from the left side of the word , Returns several characters to the left of the string |
| RIGHT | Take the string from the right word , Returns several characters to the right of the string |
| TRIM | Delete the spaces on the left and right of the string |
| REPLACE | String replacement function , Return the new string after replacement |
| SUBSTRING | Intercepting string , Returns a character change of a specified length starting at a specified location |
| REVERSE | String inversion ( The reverse ) function , Returns the string in reverse order to the original string |
Date function
| The name of the function | do use |
|---|---|
| CURDATE and CURRENT_DATE | The two functions work the same , Returns the date value of the current system |
| CURTIME and CURRENT_TIME | The two functions work the same , Returns the time value of the current system |
| NOW and SYSDATE | The two functions work the same , Returns the date and time values of the current system |
| MONTH | Get the month in the specified date |
| MONTHNAME | Get the English name of the month in the specified date |
| DAYNAME | Get the English name of the day of the week corresponding to the specified date |
| DAYOFWEEK | Gets the index location value of the week corresponding to the specified date |
| WEEK | Get the specified date is the week of the year , Whether the return value range is 0〜52 or 1〜53 |
| DAYOFYEAR | The date of acquisition is the day of the year , The return value range is 1~366 |
| DAYOFMONTH | Get the specified date is the day of the month , The return value range is 1~31 |
| YEAR | Get year , The return value range is 1970〜2069 |
| TIME_TO_SEC | Convert the time parameter to seconds |
| SEC_TO_TIME | Convert seconds to time , And TIME_TO_SEC They're inverse functions to each other |
| DATE_ADD and ADDDATE | The two functions have the same function , All add the specified time interval to the date |
| DATE_SUB and SUBDATE | The two functions have the same function , It's all subtracting the specified time interval from the date |
| ADDTIME | Time addition operation , Add the specified time... To the original time |
| SUBTIME | Time subtraction , Subtract the specified time from the original time |
| DATEDIFF | Get the interval between two dates , Returns the parameter 1 Subtract the parameter 2 Value |
| DATE_FORMAT | Format the specified date , Returns the value of the specified format according to the parameter |
| WEEKDAY | Get the corresponding working day index of the specified date in a week |
Aggregate functions
| The name of the function | effect |
|---|---|
| MAX | Query the maximum value of the specified column |
| MIN | Query the minimum value of the specified column |
| COUNT | Count the number of rows in the query result |
| SUM | Sum up , Returns the sum of the specified columns |
| AVG | averaging , Returns the average of the specified column data |
The more you know , The more you don't know .
边栏推荐
猜你喜欢

C进阶——数据的存储

Leetcode:51. queen n

Linked list - 142. Ring linked list II

Counter attack dark horse: devdbops training, give you the best courses!

Source code analysis sentry user behavior record implementation process

leetcode:51. N 皇后

容错、熔断的使用与扩展
![[rust] Why do I suggest you learn rust | a preliminary study of rust](/img/33/a5e7d22e87502fa8582920cb34de9f.png)
[rust] Why do I suggest you learn rust | a preliminary study of rust

【C和指针第14章】预处理器

1184. Distance between bus stops: simple simulation problem
随机推荐
An analysis of the CPU surge of an RFID tag management system in.Net
Dry goods sharing - taking over a new data team as a lead - Problem Inventory and insights findings
20000 words detailed explanation, thoroughly understand es!
L1-043 阅览室
Please ask whether Oracle CDC does not support checkpointing. When the task is suspended and restarted during the real-time collection process, is the data changed
基于ARM和FPGA的数字示波器设计——QMJ
Design of digital oscilloscope based on arm and FPGA -- QMJ
Makefile quick use
生信周刊第37期
Common shortcuts to VIM editor
Blue team resource collection
Quick check list of various XSS payloads
Linked list - Sword finger offer interview question 02.07. linked list intersection
How to use a third party without obtaining root permission topic: MIUI chapter
QT notes - EventFilter event filter
[data mining engineer - written examination] sheen company in 2022
String - 541. Reverse string II
Easy to use example
Understand the storage and retrieval of data
L2-011 玩转二叉树