应该是这句sql语句有问题 请拿到查询分析器中执行检查分析。 'insert into average(A0101,dept_id,average_cent) SELECT a.a0101, a.dept_id, AVG(a.true_cent * b.per) AS average_cent FROM standrd b,person a where b.dept_id = a.dept_id AND b.standard_name = a.standard_name GROUP BY a.a0101, a.dept_id'
例如 :if average.recordcount>0 then begin {insert} end else begin {update}
我是个菜鸟,才解除delphi,很多都不知道!谢谢了!
请拿到查询分析器中执行检查分析。
'insert into average(A0101,dept_id,average_cent) SELECT a.a0101, a.dept_id, AVG(a.true_cent * b.per) AS average_cent FROM standrd b,person a where b.dept_id = a.dept_id AND b.standard_name = a.standard_name GROUP BY a.a0101, a.dept_id'
begin
{insert}
end
else begin {update}