22,209
社区成员
发帖
与我相关
我的任务
分享
select cj.nu,name,age,km,fen,
(select sum(fen) from cj where nu=xx.nu)zf
from cj,xx where xx.nu=cj.nu
select
a.nu,name,age,km,fen,(select sum(fen) from cj where nu = a.nu) sfen
into
#c
from
cj a join xx b
on
b.nu=a.nu
select * from #c
select a.nu,name,age,km,fen,(select sum(fen) from cj where nu = a.nu) sfen
into #c
from cj a,xx b
where b.nu=a.nu
select *
from #c
select nu,name,age,km,sum(isnull(fen,0))from #c group by nu,name,age,km