select distinct riqi,
isnull((select sum(newTab1.kuan) From TableName as newTab1 where newTab1.zhan='zhan1' and newTab1.riqi=TableName.riqi),0) as kuan1,
isnull((select sum(newTab2.ren) From TableName as newTab2 where newTab2.zhan='zhan1' and newTab2.riqi=TableName.riqi),0) as Ren1,
isnull((select sum(newTab3.kuan) From TableName as newTab3 where newTab3.zhan='zhan2' and newTab3.riqi=TableName.riqi),0) as kuan2,
isnull((select sum(newTab4.ren) From TableName as newTab4 where newTab4.zhan='zhan2' and newTab4.riqi=TableName.riqi),0) as Ren2
from TableName
至于别的合计字段,你可以使用报表里的功能
sql server 可能能用 paradox不行