当前位置:网站首页>MySQL digital function
MySQL digital function
2022-07-06 17:00:00 【My71】
The database used in the following , May refer to Create exercise database
Find the absolute value
function :ABS(number)
Instructions
SELECT ABS(10) AS Take the absolute value , ABS(-10) AS Take the absolute value ;Running results

averaging
function :AVG( Field )
demand : Calculation xs_kc The middle school number is 081101 Students' average grades in all courses .
Instructions
select Student number , Course no. ,avg( achievement ) as Average score from xs_kc where Student number ="081101"Running results

Sum up
function :SUM()
demand : Calculation xs_kc The grades of all students in the table and .
Instructions
select sum( achievement ) as Total score from xs_kcRunning results

Exponentiation
function :POW(x,y)
explain : return x Of y Power
Instructions
SELECT POW(2,3),POW(3,2);Running results

Seeking remainder
function :MOD(x,y)
explain : The return value is x Divide y The remainder of .
Instructions
SELECT MOD(10,3),MOD(10,5);Running results

to be divisible by
grammar :x DIV y
explain : return x Divide y The integer part of the result , No rounding .
Instructions
SELECT 10 DIV 3,5 DIV 2;Running results

Rounding up
function :CEIL()
explain : This function will return a minimum integer greater than or equal to this number .
Instructions
select CEIL(1.5);Running results

Rounding down
function :FLOOR()
explain : This function will return a minimum integer less than or equal to this number .
Instructions
select FLOOR(1.5);Running results

Round to the nearest whole
function :ROUND()
Instructions
SELECT ROUND(1.23),ROUND(1.57);Running results

After decimal point n position
function :TRUNCATE(x,y)
explain :x Is the decimal to be processed ,y It's the number of reserved digits , No rounding occurs .
Instructions
SELECT TRUNCATE(3.1415926,2),TRUNCATE(3.1415926,4);Running results

Return the maximum value in the field
function :MAX()
demand : find xs_kc The record with the highest score in the table .
demand
select Student number , Course no. ,max( achievement ) as Maximum score from xs_kc;Running results

Return the minimum value in the field
function :MIN()
demand : find xs_kc The record with the lowest score in the table .
Instructions
select Student number , Course no. ,min( achievement ) as Maximum score from xs_kc;Running results

Angle in radians
function :RADIANS()
Instructions
SELECT RADIANS(60),RADIANS(90);Running results

The angle of arc
function :DEGREES()
Instructions
SELECT DEGREES(1.0471975511965976),DEGREES(1.5707963267948966);Running results

边栏推荐
- After idea installs the plug-in, restart the plug-in and disappear
- LeetCode1556. Thousand separated number
- 字节跳动技术面试官现身说法:我最想pick什么样的候选人
- Usage of insert() in vector
- Eureka single machine construction
- Shell_ 06_ Judgment and circulation
- 亮相Google I/O,字节跳动是这样应用Flutter的
- Record the error reason: terminate called after throwing an instance
- Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021
- LeetCode 1020. Number of enclaves
猜你喜欢
![[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.](/img/ef/2072aac5f85c7daf39174784dec7ee.jpg)
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.

Solr standalone installation

Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.

~84 form supplement

ByteDance open source Gan model compression framework, saving up to 97.8% of computing power - iccv 2021

Error occurred during initialization of VM Could not reserve enough space for object heap

「博士毕业一年,我拿下 ACL Best Paper」

Install docker under windows10 (through Oracle VM VirtualBox)

Activit零零碎碎要人命的坑

Usage of insert() in vector
随机推荐
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
Alibaba cloud server builds SVN version Library
字节跳动技术面试官现身说法:我最想pick什么样的候选人
The most lost road I have ever walked through is the brain circuit of ByteDance programmers
~70 row high
Redis standalone startup
~74 JD top navigation bar exercise
Shell_ 03_ environment variable
J'ai traversé le chemin le plus fou, le circuit cérébral d'un programmeur de saut d'octets
Alibaba cloud server docker installation mysql5.5
LeetCode 1558. Get the minimum number of function calls of the target array
Shell_ 04_ Shell script
@RequestMapping、@GetMapping
这116名学生,用3天时间复刻了字节跳动内部真实技术项目
(multiple methods, need to continue to see) 7-11 go deep into the tiger's Den
Activiti目录(五)驳回、重新发起、取消流程
Erlang installation
LeetCode 1984. Minimum difference in student scores
was unable to send heartbeat
汇编语言寻址方式