mysql儲存過程基本函式

2021-06-18 04:42:02 字數 1475 閱讀 1417

mysql儲存過程基本函式——日期時間類:addtime (date2 ,time_interval ) //將time_interval加到date2;convert_tz (datetime2 ,fromtz ,totz ) //轉換時區;current_date ( ) //當前日期;current_time ( ) //當前時間...

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) //分 

mysql儲存過程基本函式

一.字串類 charset str 返回字串字符集 concat string2 連線字串 instr string substring 返回substring首次在string中出現的位置,不存在返回0 lcase string2 轉換成小寫 left string2 length 從string...

mysql儲存過程基本函式

一.字串類 charset str 返回字串字符集 concat string2 連線字串 instr string substring 返回substring首次在string中出現的位置,不存在返回0 lcase string2 轉換成小寫 left string2 length 從string...

mysql儲存過程基本函式

mysql儲存過程基本函式 一.字串類 charset str 返回字串字符集 concat string2 連線字串 instr string substring 返回substring首次在string中出現的位置,不存在返回0 lcase string2 轉換成小寫 left string2 ...