please help me in optimizing this query ..
UPDATE DealReq_DealReqDtl_BB_T1 from
(select CASE WHEN (T1.BGSTOR='')
AND (T1.BSSTOR='')
THEN
'01*'
Else
''
END ||
CASE
WHEN (T1.NTUPCN='')
THEN
'04*'
ELSE
''
END from DealReq_DealReqDtl_BB_T1 T1 ) as E(E1)
SET Error_Code = E1
UPDATE DealReq_DealReqDtl_BB_T1 from
(select CASE WHEN (T1.BGSTOR='')
AND (T1.BSSTOR='')
THEN
'01*'
Else
''
END ||
CASE
WHEN (T1.NTUPCN='')
THEN
'04*'
ELSE
''
END from DealReq_DealReqDtl_BB_T1 T1 ) as E(E1)
SET Error_Code = E1