Guest_imported
New member
- Jan 1, 1970
- 0
I know there has to be a simple answer to this.
I have two tables: Table A contains line-item records for a set of orders for the current year only keyed on ORDER_NUMBER. Table B has header records for ALL orders, also keyed on ORDER_NUMBER.
Table A:
ORDER_NUMBER VARCHAR2(10)
ORDER_TYPE VARCHAR2(4)
LINE_ITEM VARCHAR2(6)
PRODUCT VARCHAR2(10)
QTY FLOAT(126)
EXT_PRICE FLOAT(126)
TOTAL_TAX FLOAT(126)
Table B:
ORDER_NUMBER VARCHAR2(10)
ORDER_TYPE VARCHAR2(4)
WAREHOUSE VARCHAR2(4)
CUST_SHIP_TO VARCHAR2(12)
TOTAL_TAX FLOAT(126)
I need to update records in Table A with the contents of the ORDER_TYPE and TOTAL_TAX fields in Table B. Remember, not every ORDER_NUMBER in B is in A; for every matching ORDER_NUMBER, there will be 1 to n records in A for every one in B.
How do I write an UPDATE to do this?
Thanks for your help!
Lee
lee.meinhardt@smna.com
I have two tables: Table A contains line-item records for a set of orders for the current year only keyed on ORDER_NUMBER. Table B has header records for ALL orders, also keyed on ORDER_NUMBER.
Table A:
ORDER_NUMBER VARCHAR2(10)
ORDER_TYPE VARCHAR2(4)
LINE_ITEM VARCHAR2(6)
PRODUCT VARCHAR2(10)
QTY FLOAT(126)
EXT_PRICE FLOAT(126)
TOTAL_TAX FLOAT(126)
Table B:
ORDER_NUMBER VARCHAR2(10)
ORDER_TYPE VARCHAR2(4)
WAREHOUSE VARCHAR2(4)
CUST_SHIP_TO VARCHAR2(12)
TOTAL_TAX FLOAT(126)
I need to update records in Table A with the contents of the ORDER_TYPE and TOTAL_TAX fields in Table B. Remember, not every ORDER_NUMBER in B is in A; for every matching ORDER_NUMBER, there will be 1 to n records in A for every one in B.
How do I write an UPDATE to do this?
Thanks for your help!
Lee
lee.meinhardt@smna.com