Reputation: 11
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.
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 |
Upvotes: 0
Views: 671
Reputation: 11102
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.
Upvotes: 1