可以用一个query来返回结果
query.close;
query.sql.clear;
query.sql.add('select count(*) from table where field=:xxx');
query.parambyname('xxx').asstring:=value;
query.open;
while query.eof<> truedo
begin
sqlcount:=query.fields[0].asinteger;
query.next;
end;
sqlcount值即为你要的值.