Batch update data comparison between Oracle and sqlserver

Source: Internet
Author: User

1. SQL Server statement:

-- Update upload point table data
Update id_master set oncall_id = tb_points.oncall_id,
Servername = tb_points.servername,
Siscode = tb_points.siscode,
Loc_id = tb_points.jzcode,
Unit = tb_points.unit,
Description = tb_points.pointname
From tb_points
Where id_master.servername = tb_points.servername and
Id_master.siscode = tb_points.siscode
-- Update switch quantity data
Update buffer_digi set ctr_value = tb_points.realvalue,
Value_time = tb_points.inputdate
From tb_points, id_master
Where buffer_digi.oncall_id = id_master.oncall_id and
Buffer_digi.trans_id = id_master.trans_id and
Buffer_digi.loc_id = id_master.loc_id and
Id_master.servername = tb_points.servername and
Id_master.siscode = tb_points.siscode

2. Writing in Oracle

-- Update unit information
Update tb_pointconfig a set (generatorid) =
(Select decode (B. "groupid", 1, 13, 2, 14) as JZ
From sssj B where a. uploadid = B. "ID" and A. factoryid = 9 and (B. "groupid" = 1 or B. "groupid" = 2 ))

-- Use the merge method to update data

Merge into tb_realtimedatavalue
Using tb_pointconfig B
On (A. FID = B. factoryid and A. uploadid = B. uploadid)
When matched then
Update set a. pointid = B. ID
Where a. FID = 13

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.