Oracle-时间与字符串转换
时间:2021-07-01 10:21:17
帮助过:181人阅读
UPDATE_TIME 是时间,直接转成字符串
SELECT to_char(
MAX(UPDATE_TIME),
‘yyyy-mm-dd hh24:mi:ss‘)
as lastUpdateTime,
to_char(sysdate, ‘yyyy-mm-dd hh24:mi:ss‘)
as accountTime
FROM QLK_AREA;
-- LASTUPDATETIME 是字符串,先转成时间,再转成字符串
SELECT to_char(to_date(
MAX(LASTUPDATETIME),
‘yyyymmddhh24miss‘),
‘yyyy-mm-dd hh24:mi:ss‘)
as lastUpdateTime,
to_char(sysdate, ‘yyyy-mm-dd hh24:mi:ss‘)
as accountTime
FROM PSN_MZ_LHDJXX_BL;
Oracle-时间与字符串转换
标签:from count 字符 pre ora sda account update miss