MaheshRathi
Technical User
Hi,
I have a doubt wrt PL/SQL - nested update query ..
My requirement is to update one column value based on some conditions i.e. based on the values in two different tables.
Here is a select query for reference .. which gives the relation -
SELECT A.BILLING_ACCOUNT_NUMBER, A.ACCOUNT_ID, B.ORDER_ID,
B.BILLING_ACCOUNT_NUMBER, B.CLASS_OF_SERVICE, B.ACCOUNT_PROVIDER_ID,
C.OWNER_NAME, C.subgroup_type_id
FROM
SDA_POF.ACCOUNTCOMMON A,
SDA_POF.POF_ACCOUNT B,
SDA_POF.DSL_DETAIL_INFO C
WHERE
C.ORDER_ID = B.ORDER_ID AND
C.SUBGROUP_TYPE_ID = 1510 AND
A.BILLING_ACCOUNT_NUMBER = B.BILLING_ACCOUNT_NUMBER AND
A.ACCOUNT_ID
IN( 180390, 11805635, 11719914, 36604, 11718956,
11720557, 11720171, 11719756, 11720785, 11715821,
11716771, 11717740, 36440, 7729116, 36174, 11718041,
11720462);
Can you please help me in resolving this? I have tried one nested update statement .. not sure if this is ok or not ..
UPDATE SDA_POF.POF_ACCOUNT B SET B.ACCOUNT_PROVIDER_ID = 657
WHERE B.BILLING_ACCOUNT_NUMBER
IN (
( SELECT BILLING_ACCOUNT_NUMBER FROM SDA_POF.ACCOUNTCOMMON
WHERE ACCOUNT_ID
IN ( 11805635, 11719914, 36604, 11718956,
11720557, 11720171, 11719756, 11720785, 11715821,
11716771, 11717740, 36440, 7729116, 36174, 11718041,
11720462)
) )
AND B.ORDER_ID
IN (
SELECT ORDER_ID FROM SDA_POF.DSL_DETAIL_INFO
WHERE SUBGROUP_TYPE_ID = 1510
);
regards,
Mahesh
I have a doubt wrt PL/SQL - nested update query ..
My requirement is to update one column value based on some conditions i.e. based on the values in two different tables.
Here is a select query for reference .. which gives the relation -
SELECT A.BILLING_ACCOUNT_NUMBER, A.ACCOUNT_ID, B.ORDER_ID,
B.BILLING_ACCOUNT_NUMBER, B.CLASS_OF_SERVICE, B.ACCOUNT_PROVIDER_ID,
C.OWNER_NAME, C.subgroup_type_id
FROM
SDA_POF.ACCOUNTCOMMON A,
SDA_POF.POF_ACCOUNT B,
SDA_POF.DSL_DETAIL_INFO C
WHERE
C.ORDER_ID = B.ORDER_ID AND
C.SUBGROUP_TYPE_ID = 1510 AND
A.BILLING_ACCOUNT_NUMBER = B.BILLING_ACCOUNT_NUMBER AND
A.ACCOUNT_ID
IN( 180390, 11805635, 11719914, 36604, 11718956,
11720557, 11720171, 11719756, 11720785, 11715821,
11716771, 11717740, 36440, 7729116, 36174, 11718041,
11720462);
Can you please help me in resolving this? I have tried one nested update statement .. not sure if this is ok or not ..
UPDATE SDA_POF.POF_ACCOUNT B SET B.ACCOUNT_PROVIDER_ID = 657
WHERE B.BILLING_ACCOUNT_NUMBER
IN (
( SELECT BILLING_ACCOUNT_NUMBER FROM SDA_POF.ACCOUNTCOMMON
WHERE ACCOUNT_ID
IN ( 11805635, 11719914, 36604, 11718956,
11720557, 11720171, 11719756, 11720785, 11715821,
11716771, 11717740, 36440, 7729116, 36174, 11718041,
11720462)
) )
AND B.ORDER_ID
IN (
SELECT ORDER_ID FROM SDA_POF.DSL_DETAIL_INFO
WHERE SUBGROUP_TYPE_ID = 1510
);
regards,
Mahesh