[英]Redshift insert a date value into a table
insert into table1 (ID,date)
select
ID,sysdate
from table2
assume i insert a record into table2 with value ID:1,date:2023-1-1 the expected result is update the ID of table1 base on the ID from table2 and update the value of date of table1 base on the sysdate from table2.假设我向表 2 中插入一条记录,其值为 ID:1,日期:2023-1-1 预期结果是根据表 2 中的 ID 更新表 1 的 ID,并根据表 2 中的 sysdate 更新表 1 的日期值。
select *
from table1;
the expected result after running the insert statement will be运行插入语句后的预期结果将是
ID ![]() |
date![]() |
---|---|
1 ![]() |
2023-1-6 ![]() |
but what i get is:但我得到的是:
ID ![]() |
date![]() |
---|---|
1 ![]() |
2023-1-1 ![]() |
I see a few possibilities based on the information given:根据给出的信息,我看到了一些可能性:
There are likely other possible explanations.可能还有其他可能的解释。 If you could provide DDL, sample data, and a simple test case so that others can recreate what you are seeing it would greatly narrow down the possibilities.
如果您可以提供 DDL、示例数据和一个简单的测试用例,以便其他人可以重新创建您所看到的内容,那将大大缩小可能性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.