select
编号,值=case when 标识='出2' then (select sum(值) from tablename where 编号=a.编号 and 标识 in ('进1','出1','出2'))
else 值
end,标识
from tablename a
编号,值=case when 标识='出2' then (select sum(值) from tablename where 编号=a.编号 and 标识 in ('进1','出1','出2'))
else 值
end,标识
from tablename a
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货