以下是引用小水滴在2006-11-1 21:41:51的发言: select servername,case when shuliang is null then 0 else shuling end from table1 left join table2 on table1.serverid=table2.serverid
select a.servername,isnull(b.shuiliang3,0),sum(isnull(b.shuiliang,0)) from table1 a left join table2 b on a.serverid=b.serverid group by a.servername, b.shuiliang