问题
你试图解析12小时(AM / PM)时间值to_timestamp (),而是返回一个24小时的时间值则返回null。
例如,此示例代码:
% sql SELECT to_timestamp(' 2016-12-31 10:12:00点',' yyyy-MM-dd HH: mm: ss ');
返回null运行时:
导致
to_timestamp ()需要在小时格式小写的。
如果时间格式是用大写字母,to_timestamp ()返回null。
解决方案
确保你在小写字母指定小时格式。
例如,此示例代码:
% sql SELECT to_timestamp(' 2016-12-31 10:12:00点',' yyyy-MM-dd hh: mm: ss ');
返回时间为24小时的时间价值。