We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Update table column based in value occurrence

Accepted answer
5
Views
4
Comments
edited Aug 31, 2021 6:55AM in Database 4 comments

Content

I want to update table A column item_number on basis of table B for all rows that appear till item_location:'GRAND TOTAL:' occurrence in the column.
Please check the below tables for more clarity and help me to build this logic in oracle db.

Table B

Item_number
ZC-M3
RC-4-2
RC-4-2

Table A

order_number Business_Unit QTY_AVAILABLE ITEM_LOCATION LOT_SERIAL Item_number record_id
1953454 111001 22585 6007.104.007 1850206 null 10756117
1953454 111001 68420 6007.104.009 1850210 null 10756118
1953454 111001 -103000 COMP.ONE.NTS   null 10756119
1953454 111001 -11995 TOTAL: null null 10756120
1953454 111001 -11995 GRAND TOTAL: null null 10756121
1953454 111001 38860 6005.101.007 1875163 null 10756122
1953454 111001 40000 6005.101.009 1875163 null 10756123
1953454 111001 14060 6005.102.005 1875164 null 10756124
1953454 111001 60000 6005.103.009 1875162 null 10756125
1953454 111001 1540 6005.106.007 1677779 null 10756126
1953454 111001 -137500 COMP.ONE.NTS   null 10756127
1953454 111001 16960 TOTAL: null null 10756128
1953454 111001 16960 GRAND TOTAL:
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!