numeric operators and functions

Source: Internet
Author: User

Ceil rounding up/go in and take the whole MySQL> SelectCeil (3.01);+------------+|Ceil (3.01)|+------------+|          4 |+------------+1Rowinch Set(0.40sec) #取舍一取整, rounding down MySQL> Select  Floor(3.99);+-------------+|  Floor(3.99)|+-------------+|           3 |+-------------+1Rowinch Set(0.00sec) #整数除法mysql> Select 3/4;+--------+| 3/4    |+--------+| 0.7500 |+--------+1Rowinch Set(0.00sec) #divmysql> Select 3Div4;+---------+| 3Div4 |+---------+|       0 |+---------+1Rowinch Set(0.00sec) #取模/take the remainder, all the same concept MySQL> Select 5.3MoD3;+-----------+| 5.3MoD3 |+-----------+|       2.3 |+-----------+1Rowinch Set(0.00sec) #Powerpower operation, 2 x 3-time MySQL> Select Power(2,3);+------------+| Power(2,3)|+------------+|          8 |+------------+1Rowinch Set(0.07sec) #四舍五入mysql> Select round(3.6523,2);//2 decimal places reserved+-----------------+| round(3.6523,2)|+-----------------+|            3.65 |+-----------------+1Rowinch Set(0.00sec) MySQL> Select round(3.6523,1);//1 decimal places reserved+-----------------+| round(3.6523,1)|+-----------------+|             3.7 |+-----------------+1Rowinch Set(0.00sec) #数字截取, just intercept numbers, use less MySQL> Select truncate(123.6523,2);+----------------------+| truncate(123.6523,2)|+----------------------+|               123.65 |+----------------------+1Rowinch Set(0.00sec) MySQL> Select truncate(123.652,1);+---------------------+| truncate(123.652,1)|+---------------------+|               123.6 |+---------------------+1Rowinch Set(0.00sec) MySQL> Select truncate(123.652,0);+---------------------+| truncate(123.652,0)|+---------------------+|                 123 |+---------------------+1Rowinch Set(0.00Sec

numeric operators and functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.