我在Oracle 9i中遇到了这种奇怪的行为:
select
t.final_day,
to_char(t.final_day,'DD/MM/YYYY HH24:MI:SS') final_day1,
t.week_first_day,
to_char(t.week_first_day,'DD/MM/YYYY HH24:MI:SS') week_first_day1
from
mytable t
where
t.rowid in ( 'AAAJ6QAAZAAACenAAW','AAAJ6QAAZAAACenAAT')
order by
t.end_date
奇怪的是,没有时间插入的日期(默认为00:00/12:00 AM)将OK转换为图表,但插入时间的日期无法转换为char:
FINAL_DAY FINAL_DAY1 WEEK_FIRST_DAY WEEK_FIRST_DAY1
7/19/2015 12:00:00 AM 19/07/2015 00:00:00 7/13/2015 12:00:00 AM 13/07/2015 00:00:00
7/25/2015 11:00:00 PM 00/00/0000 00:00:00 7/19/2015 11:00:00 PM 00/00/0000 00:00:00
更新
这是我将转储功能应用于两个日期列时得到的结果:
DUMP1 DUMP2
Typ=12 Len=7: 120,115,7,19,1,1,1 Typ=12 Len=7: 120,115,7,13,1,1,1
Typ=12 Len=7: 120,115,7,26,0,1,1 Typ=12 Len=7: 120,115,7,20,0,1,1
UPDATE2:
两列都是DATE
类型。行为alter session set nls_date_format = 'DD/MM/YYYY HH24:MI:SS';
后,行为仍然存在。