???????????????
????ABS (number2 ) //?
????BIN (decimal_number ) //????????????
????CEILING (number2 ) //???????
????CONV(number2??from_base??to_base) //???????
????FLOOR (number2 ) //???????
????FORMAT (number??decimal_places ) //????С??λ??
????HEX (DecimalNumber ) //????????
???????HEX()?п?????????????????ASC-11????HEX(’DEF’)????4142143
?????????????????????????????????????????HEX(25)????19
????LEAST (number ?? number2 [??..]) //??С?
????MOD (numerator ??denominator ) //????
????POWER (number ??power ) //?????
????RAND([seed]) //?????
????ROUND (number [??decimals ]) //????????decimals?С??λ??]
???????????????????????????磺
????(1)??????????
????mysql> select round(1.23);
????+————-+
????| round(1.23) |
????+————-+
????| 1 |
????+————-+
????1 row in set (0.00 sec)
????mysql> select round(1.56);
????+————-+
????| round(1.56) |
????+————-+
????| 2 |
????+————-+
????1 row in set (0.00 sec)
????(2)?????趨С??λ?????????????????
????mysql> select round(1.567??2);
????+—————-+
????| round(1.567??2) |
????+—————-+
????| 1.57 |
????+—————-+
????1 row in set (0.00 sec)
????SIGN (number2 ) //??????????????0
????SQRT(number2) //?????
????????????????
????ADDTIME (date2 ??time_interval ) //??time_interval???date2
????CONVERT_TZ (datetime2 ??fromTZ ??toTZ ) //??????
????CURRENT_DATE ( ) //???????
????CURRENT_TIME ( ) //??????
????CURRENT_TIMESTAMP ( ) //???????
????DATE (datetime ) //????datetime?????????
????DATE_ADD (date2 ?? INTERVAL d_value d_type ) //??date2?м???????????
????DATE_FORMAT (datetime ??FormatCodes ) //???formatcodes??????datetime
????DATE_SUB (date2 ?? INTERVAL d_value d_type ) //??date2??????????
????DATEDIFF (date1 ??date2 ) //?????????
????DAY (date ) //???????????
????DAYNAME (date ) //???????
????DAYOFWEEK (date ) //????(1-7) ??1???????
????DAYOFYEAR (date ) //????е?????
????EXTRACT (interval_name FROM date ) //??date?????????????????
????MAKEDATE (year ??day ) //?????????е??????????????
????MAKETIME (hour ??minute ??second ) //???????
????MONTHNAME (date ) //????·???
????NOW ( ) //??????
????SEC_TO_TIME (seconds ) //??????????
????STR_TO_DATE (string ??format ) //???????????format??????
????TIMEDIFF (datetime1 ??datetime2 ) //????????
????TIME_TO_SEC (time ) //????????]
????WEEK (date_time [??start_of_week ]) //?????
????YEAR (datetime ) //???
????DAYOFMONTH(datetime) //?μ?????
????HOUR(datetime) //С?
????LAST_DAY(date) //date???μ??????
????MICROSECOND(datetime) //???
????MONTH(datetime) //??
????MINUTE(datetime) //??
?????????????INTERVAL?е??????DAY ??DAY_HOUR ??DAY_MINUTE ??DAY_SECOND ??HOUR ??HOUR_MINUTE ??HOUR_SECOND ??MINUTE ??MINUTE_SECOND??MONTH ??
SECOND ??YEAR
????DECLARE variable_name [??variable_name...] datatype [DEFAULT value];
???????У?datatype?mysql?????????????:INT?? FLOAT?? DATE?? VARCHAR(length)
????????
????DECLARE l_int INT unsigned default 4000000;
????DECLARE l_numeric NUMERIC(8??2) DEFAULT 9.95;
????DECLARE l_date DATE DEFAULT '1999-12-31';
????DECLARE l_datetime DATETIME DEFAULT '1999-12-31 23:59:59';
????DECLARE l_varchar VARCHAR(255) DEFAULT 'This will not be padded';