declare @AA int select @AA=(Select F1 from T1 where ....) as AA,bb from T2
var str:string; begin adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add('select aa from table1 where ......'); adoquery1.open; str := adoquery1.FieldByName('aa').AsString; end;
select @AA=(Select F1 from T1 where ....) as AA,bb from T2
str:string;
begin
adoquery1.close;
adoquery1.sql.clear;
adoquery1.sql.add('select aa from table1 where ......');
adoquery1.open;
str := adoquery1.FieldByName('aa').AsString;
end;