2,507
社区成员
发帖
与我相关
我的任务
分享var
temp1,temp2:String;
begin
temp1:='2009-10-10';
temp2:='合计';
adoquery1.close;
adoquery1.sql.clear;
adoquery1.sql.add('select year,yljl01,yljl02,yljl03,yljl04');
adoquery1.sql.add('from tljl where year='+''''+temp1+''''+ 'UNION all');
adoquery1.sql.add(' select '+''''+temp2+''''+',sum(yljl01),'',sum(yljl03),''');
adoquery1.sql.add('from tljl where year='+''''+temp2+''''+' group by year');
adoquery1.open;
end;select date,d1,d11,d2,d21 from table where date='2009/10/19'
UNION all
select '合计',sum(d1),'',sum(d2),'',from table where date='2009/10/19' Group by date