我有一个表,该表的时间戳为“ completed”列,但时间戳为纪元格式。我正在使用以下查询将纪元时间转换为正常日期,但是我不确定如何过滤今天创建的记录。希望有人能帮忙。
这是我正在使用的查询:
[1] FALSE TRUE TRUE
答案 0 :(得分:0)
找到了:
select name, status, message, completion_status,
TO_CHAR( FROM_TZ( CAST(DATE '1970-01-01' + (1/24/60/60/1000) * completed AS TIMESTAMP), 'America/New_York'), 'yyyy-mm-dd HH24:MI:SS')
as completed from Result
where TO_CHAR( FROM_TZ( CAST(DATE '1970-01-01' + (1/24/60/60/1000) * completed AS TIMESTAMP), 'America/New_York'), 'yyyy-mm-dd')
LIKE (SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD') as today_date FROM dual);