procedure TForm1.FormShow(Sender: TObject);
begin
with qry1 do
begin
close;
sql.clear;
sql.add( 'select stuname,score from stuinfo,stuscore union select ''合计'',sum(score) from stuinfo,stuscore order by score asc');
open;
active:=true;
end;
end;