我有两个配置单元表,一个保存一个带有timestamp数据类型的日期值。如果我使用键查询一个特定的记录,它会正确地显示日期值。从表1中选择科目关键字、开户日期,其中科目关键字=1234;
acct_id account_open_date
1234 1963-03-01 00:00:00
但是,当将此表与另一个表联接时,返回的时间戳值在2031年更改为某个值选择a.acct\ u key,b.account\ u open\ u date from table\ u 2 a left outer join on table\ u 1 b on a.acct\ u key=b.acct\ u key;
acct_id account_open_date
1234 2031-03-19 00:00:00
似乎这个问题只发生在unix epoch time(1970)之前的日期值。有什么建议吗?谢谢
3条答案
按热度按时间cngwdvgl1#
我无法重现你所看到的,但你可以尝试铸造
account_open_date
至string
.dgjrabp22#
这里有两个问题,第一个是join不使用timestamp和epoch timestamp。在最后一行中,我假设join为其他时间戳返回了正确的时间戳。如果我错了,请纠正我。如果这个问题解决了,你可以看看这里来处理划时代的时间
ldioqlga3#
我试过了。在嵌套查询中将时间戳转换为字符串,如下所示。我也尝试过不使用嵌套查询,但不起作用。有人知道为什么吗?
未工作版本:
工作版本: