UPDATE yi_user a
set
freezeamt=freezeamt-
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
),
amt=amt+
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
)
where
a.yuid in (
select b.srcid from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
GROUP BY
b.srcid
)
set
freezeamt=freezeamt-
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
),
amt=amt+
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
)
where
a.yuid in (
select b.srcid from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
GROUP BY
b.srcid
)