Oracle associated update syntax (update... In T-SQL... From)

Source: Internet
Author: User

 

Table join update statement:

Scenario:

Table:

Am_approve_list_log_sammy

Am_approve_list_sammy

 

Update field:

Emp_id, approver_sequence, approver_id

 

Join field:

Emp_id, approver_id

 

Method 1:

Update Am_approve_list_log_sammy
Set (A. emp_id, A. approver_sequence, A. approver_id) =
( Select B. emp_id, B. approver_sequence, B. approver_id
From Am_approve_list_sammy B
Where B. emp_id = A. emp_id And B. approver_id = A. approver_id)
  Where   Exists ( Select   1
From Am_approve_list_sammy C
Where C. emp_id = A. emp_id And C. approver_id = A. approver_id)

 

 

Method 2: (10 Gb or above)

Merge Into GT $ fm_form_field_import imp
Using fm_form_field FIE
On (Imp. field_name = Fie. field_name
And Fie. form_kind =   ' BQE. form.7 '
And Fie. table_name =   ' Bqeform7 ' )
When Matched Then
Update
Set Imp. Description = Fie. description,
Imp. is_query = Fie. is_query,
Imp. is_default_value = Fie. is_default_value,
Imp. is_query_show = Fie. is_query_show,
Imp. is_form_show = Fie. is_form_show,
Imp. is_participant ipant = Fie. is_participant ipant,
Imp. is_mail_show = Fie. is_mail_show

Related Article

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.