1. 程式人生 > >mysql004--關聯查詢,外來鍵的級聯操作,常用內建函式

mysql004--關聯查詢,外來鍵的級聯操作,常用內建函式

  • ascii()   --返回字元的sacii碼
  • char()   --檢視ascii碼對應的字元值
  • concat(var1,var2,var3)  --字串拼接
  • length(str)   --返回字元長度
  • substring(str,start,len) --字串擷取
  • trim() ltrim()  rtrim()   --字串去空格
  • space(n)  --返回n個空格組成的字串
  • replace(str,old,new)  --str中的old用new替換
  • lower()   --返回小寫格式
  • upper()  --返回大寫格式
  • abs()  --返回絕對值
  • mod(m,n)  --m%n
  • floor() --地板值
  • ceiling() --天花板值
  • round(n,d)  --n取四捨五入,d為小數點後的位數,預設值為0
  • pow(x,y) --x的y次冪
  • PI() --圓周率
  • rand() --0到1.0之間的浮點數
  • year(date)  --返回年份
  • month(date)  --返回月份
  • day(date)  --返回日期值
  • hour(date)
  • minute(date)
  • second(date)
  • date_format(date,format)  --按格式輸出日期
  • current_date()   --當前日期
  • current_time()   --當前時間
  • now()   --當前日期+時間
  • select now() + interval 1 month