Wesley13 Wesley13
2年前
mysql简单常用语句汇总
1\.常用函数uuid和时间戳SELECTUUID(),UNIX_TIMESTAMP();将时间戳转为日期格式FROM_UNIXTIME(mw.created_at,'%Y%m%d%H:%i:%s')设置参数select@m_no:max(m_no)fromvc_m;set@m
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
mysql timestamp
 select from\_unixtime(m.createdAt, '%Y%m%d %H:%i:%s') from kfrobotaidlog m;select m.customeruid, from\_unixtime(m.createtime, '%Y%m%d %H:%i:%s') as \datetime\, m.kfui
Stella981 Stella981
2年前
HIVE 时间操作函数
日期函数UNIX时间戳转日期函数: from\_unixtime语法:   from\_unixtime(bigint unixtime\, string format\)返回值: string说明: 转化UNIX时间戳(从19700101 00:00:00 UTC到指定时间的秒数)到当前时区的时间格式举例:hive   selec
Wesley13 Wesley13
2年前
mysql统计
时间转任意格式DATE_FORMATselectDATE_FORMAT(NOW(),'%m%d%Y');unix_timestamp时间转时间戳selectunix_timestamp(now());from_unixtime时间戳转时间