MySQL存储函数-基本常用函数
1、字符串类
1)mysql储存过程函数-字符串函数:
CHARSET(str)
CONCAT (string2 [,... ])
INSTR (string ,substring )
LCASE (string2 )
LEFT (string2 ,length )
LENGTH (string )
LOAD_FILE (file_name )
LOCATE (substring , string [,start_position ] )
LPAD (string2 ,length ,pad )
LTRIM (string2 )
REPEAT (string2 ,count )
REPLACE (str ,search_str ,replace_str )
RPAD (string2 ,length ,pad)
RTRIM (string2 )
STRCMP (string1 ,string2 )
SUBSTRING (str , position [,length ])
TRIM([[BOTH|LEADING|TRAILING] [padding] FROM]string2)
UCASE (string2 )
RIGHT(string2,length)
SPACE(count)
2、数学类
1)mysql储存函数-数学函数:
ABS (number2 )
BIN (decimal_number )
CEILING (number2)
CONV(number2,from_base,to_base)
FLOOR (number2)
FORMAT (number,decimal_places )
HEX (DecimalNumber )
GREATEST(number1,number2,...)
LEAST (number , number2 [,..])
MOD (numerator ,denominator )
POWER (number ,power )
RAND([seed])
ROUND (number [,decimals ])
SIGN (number)
3、日期时间类
ADDTIME (date2 ,time_interval )
CONVERT_TZ (datetime2 ,fromTZ ,toTZ )
CURRENT_DATE ( )
CURRENT_TIME ( )
CURRENT_TIMESTAMP ( )
DATE (datetime )
DATE_ADD (date2 , INTERVAL d_value d_type )
DATE_FORMAT (datetime ,FormatCodes )
DATE_SUB (date2 , INTERVAL d_value d_type )
DATEDIFF (date1 ,date2 )
DAY (date )
DAYNAME (date )
DAYOFWEEK (date )
DAYOFYEAR (date )
EXTRACT (interval_name FROM date )
MAKEDATE (year ,day )
MAKETIME (hour ,minute ,second )
MONTHNAME (date )
NOW ( )
SEC_TO_TIME (seconds )
STR_TO_DATE (string ,format )
TIMEDIFF (datetime1 ,datetime2 )
TIME_TO_SEC (time )
WEEK (date_time [,start_of_week ])
YEAR (datetime )
DAYOFMONTH(datetime)
HOUR(datetime)
LAST_DAY(date)
MICROSECOND(datetime)
MONTH(datetime)
MINUTE(datetime)
SQRT(number2)