Use oracle database A table field: A1, A2, A3, A4, A5, A6, A1 field is 1, 1.1, 1.2, 1.3,... 2, 3,... 10, 10.1, 10.2... This serial number, 1.1 is 1 item, 1 is the father of 1.1 item, now want to use A table all parent updates, the corresponding item of the A4, A5, A6 value (example: use 1 A4, A5, A6 update 1 all item 1.1, 1.2... A4, A5, A6 fields, the corresponding A2, A3 values are equal) ask you how to write this update!
CodePudding user response:
You in the conditional query update can ah, character query item, and then update; But to be honest, A1 fields as 1,1.1 this kind of structure is a bit rashCodePudding user response:
I have used the set=(select from the where) will be prompted to single subquery return multiple rows, with the merge into prompts unable to get a stable line in the source listCodePudding user response:
Normal is set=(select from the where), the query returns multiple lines is written wrong, logic or data do not tally with the rules as you describeCodePudding user response:
The update temp_simon2 a set (val1, val2)=(select val1, val2 from temp_simon2 b where trunc (Anderson, d)=b.i d and Anderson d<> B.i d)Where trunc (Anderson, d) & lt;> Anderson, d
TB: temp_simon2
Id val1 val2
1 uf in hefei,
1.1 uf in hefei,
1.2 uf in hefei,
1.21 uf in hefei,
2 ladder up Beijing
Ladder 2.1 liters Beijing
CodePudding user response: