adoqry1.close; adoqry1.sql.clear;
adoqry1.sql.text := 'select A.field1, B.field2 from tabel1 as A, table2
as B where A.id = B.id';
adoqry1.open;
while not adoqry1.eof do begin //然后以返回的结果集去捞table3.field3:
adoqry2.close; adoqry2.sql.clear;
adoqry2.sql.text := 'select field3 from table3 '
+ ' where field1 = '+ quotedstr(adoqry1.fields[0])
+ ' and field2 = ' + quotedstr(adoqry1.fields[1]);
adoqry2.open;
adoqry1.next;
end;请问以上的解决方法能否用一句SQL语句搞定, 将table1.field1, table2.field2,
table3.field3以一个结果集返回, 类似这样: select A.field1, B.field2,
C.field3 from table1 as A, table2 as B, table3 as C where ..........帮帮忙!
Ths!
adoqry1.sql.text := 'select A.field1, B.field2 from tabel1 as A, table2
as B where A.id = B.id';
adoqry1.open;
while not adoqry1.eof do begin //然后以返回的结果集去捞table3.field3:
adoqry2.close; adoqry2.sql.clear;
adoqry2.sql.text := 'select field3 from table3 '
+ ' where field1 = '+ quotedstr(adoqry1.fields[0])
+ ' and field2 = ' + quotedstr(adoqry1.fields[1]);
adoqry2.open;
adoqry1.next;
end;请问以上的解决方法能否用一句SQL语句搞定, 将table1.field1, table2.field2,
table3.field3以一个结果集返回, 类似这样: select A.field1, B.field2,
C.field3 from table1 as A, table2 as B, table3 as C where ..........帮帮忙!
Ths!
解决方案 »
- 一个公网ip如何能够访问内网ip 100分
- 如何一次过让程序里面所有的form的字体都为宋体
- 有关case integer of 的理解?
- 大家快来啊?
- 付費:aiirii给ghyghost捐献了2000可用分;ghyghost收到了:1800可用分
- 如何得到excel文件的某一单元格内容
- 请教,自动生成label和edit的问题
- ODAC安装。知道问题有点儿弱,各位海涵吧。
- *****关于datagrid中不能正常显示sql数据库中的datatime 类型字段,请教各位,定有分酬!
- 请教高手:如何得到鼠标进入和离开一控制件的事件?
- 两个小问题
- 保证clientSock和serverSock通讯无误的方法和思想是什么?在线,大侠帮忙!
as B ,TABLE3 AS C where A.id = B.id AND C.FIELD1=A.ID AND C.FIELD1=C.FIELD2
as B, table3 as C where A.id = B.id and C.field1=A.field1
and C.field2=B.field2'