22,209
社区成员
发帖
与我相关
我的任务
分享
use db_tp
update houxuanren
set 得票数=得票数+(select count(1) from new_tb where xuhao=a.自动编号) from houxuanren a
--或者
use db_tp
update houxuanren
set 得票数 = 得票数 + (select count(*) from from new_tb where xuhao = a.自动编号)
from houxuanren a
use db_tp
update houxuanren
set 得票数 = 得票数 + b.dps
from houxuanren a,
(select xuhao , count(*) dps from new_tb group by xuhao) b
where a.自动编号 = b.xuhao