自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL數(shù)學(xué)函數(shù)的實(shí)際用法

數(shù)據(jù)庫(kù) MySQL
本文主要是介紹MySQL數(shù)學(xué)函數(shù)的實(shí)際用法以及MySQL數(shù)學(xué)函數(shù)的實(shí)際操作中值得我們大家注意的事項(xiàng)的描述,以下就是文章的主要內(nèi)容。

此文章主要向大家描述的是MySQL數(shù)學(xué)函數(shù)的實(shí)際用法以及在實(shí)際操作中值得大家注意的問(wèn)題,MySQL數(shù)學(xué)函數(shù)是MySQL函數(shù)中經(jīng)常被用到的,所以對(duì)其有一定的了解還是有你有所幫助的。

ABS (number2 ) //絕對(duì)值

BIN (decimal_number ) //十進(jìn)制轉(zhuǎn)二進(jìn)制

 

CEILING (number2 ) //向上取整

 

CONV(number2,from_base,to_base) //進(jìn)制轉(zhuǎn)換

 

FLOOR (number2 ) //向下取整

 

FORMAT (number,decimal_places ) //保留小數(shù)位數(shù)

 

HEX (DecimalNumber ) //轉(zhuǎn)十六進(jìn)制

 

MySQL數(shù)學(xué)函數(shù)注:HEX()中可傳入字符串,則返回其ASC-11碼,如HEX(’DEF’)返回4142143

 

也可以傳入十進(jìn)制整數(shù),返回其十六進(jìn)制編碼,如HEX(25)返回19

 

LEAST (number , number2 [,..]) //求最小值

MOD (numerator ,denominator ) //求余

 

POWER (number ,power ) //求指數(shù)

 

RAND([seed]) //隨機(jī)數(shù)

 

ROUND (number [,decimals ]) //四舍五入,decimals為小數(shù)位數(shù)]

 

注:返回類(lèi)型并非均為整數(shù),如:

(1)默認(rèn)變?yōu)檎椭?/p>

  1. mysql> select round(1.23);   
  2. +————-+   
  3. | round(1.23) |   
  4. +————-+   
  5. | 1 |   
  6. +————-+   
  7. 1 row in set (0.00 sec)   
  8. mysql> select round(1.56);   
  9. +————-+   
  10. | round(1.56) |   
  11. +————-+   
  12. | 2 |   
  13. +————-+   
  14. 1 row in set (0.00 sec) 

2)可以設(shè)定小數(shù)位數(shù),返回浮點(diǎn)型數(shù)據(jù)

  1. mysql> select round(1.567,2);  
  2. +—————-+  
  3. | round(1.567,2) |  
  4. +—————-+  
  5. | 1.57 |  
  6. +—————-+  
  7. 1 row in set (0.00 sec) 

SIGN (number2 ) //返回符號(hào),正負(fù)或0

SQRT(number2) //開(kāi)平方

 

以上的相關(guān)內(nèi)容就是對(duì)MySQL數(shù)學(xué)函數(shù)的介紹,望你能有所收獲。

【編輯推薦】

  1. MySQL命令導(dǎo)數(shù)據(jù)的實(shí)際操作與代碼
  2. 用c語(yǔ)言正確讀取MySQL數(shù)據(jù)庫(kù)實(shí)戰(zhàn)演示
  3. jsp MySQL 中的中文問(wèn)題的產(chǎn)生與解決
  4. MySQL基本操作,新手入門(mén)寶典
  5. MySQL數(shù)據(jù)庫(kù)安全設(shè)置的操作流程
責(zé)任編輯:佚名 來(lái)源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-05-04 12:10:08

Oracle over

2010-07-19 15:01:26

Perl數(shù)學(xué)函數(shù)

2010-05-17 17:23:27

MySQL limit

2010-06-30 13:07:17

SQL Server函

2010-05-26 16:53:21

MySQL show

2010-05-31 11:13:00

MySQL Date函

2010-10-25 17:33:35

Oracle數(shù)學(xué)函數(shù)

2010-04-28 14:46:38

Oracle Copy

2010-04-28 14:56:02

Oracle sqlp

2010-04-28 16:30:52

Oracle case

2010-07-08 10:38:24

MS SQL Serv

2010-05-07 18:52:59

Oracle rown

2010-05-13 16:32:18

2009-08-06 17:14:39

P2PMessageQ

2010-04-27 14:44:31

Oracle存儲(chǔ)過(guò)程

2010-05-05 15:38:31

Oracle安全策略

2010-04-29 13:31:16

Oracle Orad

2023-03-13 08:47:06

CSS數(shù)學(xué)函數(shù)

2010-04-06 08:58:27

Oracle job

2010-04-29 10:41:55

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)