0%

数据库函数记录

MySQL 函数

字符串替换函数
REPLACE(field1, 'abc', 'def')

截取字符串函数

SUBSTRING(str1, start_index, length)

SELECT 增加自增序列

1
2
SET @counter=0;
SELECT @counter:=@counter+1 AS Rank,LastName,Roll_no as Roll FROM Students ORDER BY Roll_no ASC;

时间戳转标准时间函数

FROM_UNIXTIME(unix_timestamp ,'%Y-%m-%d %H:%i:%S')

标准时间转时间戳函数

UNIX_TIMESTAMP(date)

当前标准时间函数

NOW()

当前时间戳函数

UNIX_TIMESTAMP(NOW())

Hive 函数

时间戳转标准时间函数

FROM_UNIXTIME(unix_timestamp ,'yyyyMMdd')

欢迎关注我的其它发布渠道