Oralce two table structure update

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.