var s:string;
begin
with query1 do
begin
close;
sql.clear;
sql.add('select yourfieldname from table');
open;
s:=FieldByname('youfieldname').AsString;
end;
end;
如果要取得所有该字段的结果,用
with query1 do
begin
close;
sql.clear;
sql.add('select yourfieldname from table');
open;
first;
while not eof do
begin
.
{将字段值赋给一个数组变量}
.
next
end;
end;