Currently, I use a table as a project. When processing data, I need to filter out the data to be saved in another table (the table structure is the same as that used to filter data tables as a temporary table processing service ), then two dates are calculated. Now we need to update the two dates with the same IDs in the temporary table back to the data table. The Oracle SQL statement is as follows: Update DPS. day_cut_plan
Set
DPS. day_cut_plan.plan_start_time = (select DPS. t_day_cut_plan.plan_start_time from DPS. t_day_cut_plan where DPS. day_cut_plan.wo_id = DPS. t_day_cut_plan.wo_id ),
DPS. day_cut_plan.plan_end_time = (select DPS. t_day_cut_plan.plan_end_time from DPS. t_day_cut_plan where DPS. day_cut_plan.wo_id = DPS. t_day_cut_plan.wo_id)
Where DPS. day_cut_plan.wo_id in (select DPS. t_day_cut_plan.wo_id from DPS. t_day_cut_plan );
The following SQL statements can be run in SQL Server 2000, but cannot be run in Oracle, because the where condition of Oracle cannot have two tables.
The following statements can be run on SQL Server in Oracle. I don't know why it cannot be run.
Update DPS. day_cut_plan
Set
DPS. day_cut_plan.plan_start_time = DPS. t_day_cut_plan.plan_start_time,
DPS. day_cut_plan.plan_end_time = DPS. t_day_cut_plan.plan_end_time
From DPS. day_cut_plan, DPS. t_day_cut_plan
Where DPS. day_cut_plan.wo_id = DPS. t_day_cut_plan.wo_id
Joe peak-11-23 at Lanzhou tobacco factory Information Center