Home > database >  How to realize the update oracle set
How to realize the update oracle set

Time:10-21

The update sd_sales_high_lh
Set
Date_id=b.d ate_id,
F2=b. 2,
F3=b. 3
The from sd_sales_high_lh a join sd_sales_high_lhm b
On a.y ear_id=b.y ear_id
And a.s tore_code=b.s tore_code
And a. d. ept_type=b.d ept_type
Where a.y ear_id=cur_year
And 2 is null a.f

How to realize the undate

CodePudding user response:

. Set (date_id, f2 and f3)=(2, the select date_id, b. b. 3... )

CodePudding user response:

The above statement completion,
The update sd_sales_high_lh a
Set (date_id, f2 and f3)=
(select date_id, f2 and f3
The from sd_sales_high_lhm b
Where a.y ear_id=b.y ear_id
And a.s tore_code=b.s tore_code
And a. d. ept_type=b.d ept_type)
Where 1=1
And the exists (select 1
The from sd_sales_high_lhm b
Where a.y ear_id=b.y ear_id
And a.s tore_code=b.s tore_code
And a. d. ept_type=b.d ept_type)

CodePudding user response:

The
refer to the original poster MXX_xx response:
update sd_sales_high_lh
Set
Date_id=b.d ate_id,
F2=b. 2,
F3=b. 3
The from sd_sales_high_lh a join sd_sales_high_lhm b
On a.y ear_id=b.y ear_id
And a.s tore_code=b.s tore_code
And a. d. ept_type=b.d ept_type
Where a.y ear_id=cur_year
And 2 is null a.f

How to realize the undate


1, in oracle, this need to use the update, will use related sub queries;
2, if the update data set is large, there may be performance issues, best to merge into syntax, concrete syntax can be searched,
  • Related