一
一成
Unregistered / Unconfirmed
GUEST, unregistred user!
用子查询写
query1.close;
query1.sql.text:='select name from stu where deptid=(select id from dept where deptname="九八三班")';
query1.open;
分开写如下
query1.close;
query1.sql.text:='select id from dept where deptname="九八三班"';
query1.open;
mydeptid:=query1.fieldbyname('id').asinteger;
query1.close;
query1.sql.text:='select name from stu where deptid="'+mydeptid+'"'
query1.open;
有没有人调试过,哪一个更快?
query1.close;
query1.sql.text:='select name from stu where deptid=(select id from dept where deptname="九八三班")';
query1.open;
分开写如下
query1.close;
query1.sql.text:='select id from dept where deptname="九八三班"';
query1.open;
mydeptid:=query1.fieldbyname('id').asinteger;
query1.close;
query1.sql.text:='select name from stu where deptid="'+mydeptid+'"'
query1.open;
有没有人调试过,哪一个更快?