你的问题都说不清楚,叫别人怎么详细回答?
三个表有什么关联,是把取出的值添加到combobox的Items里还是选择combobox里的某个Item,根据这个Item进行三个表的查询?
三个表有什么关联,是把取出的值添加到combobox的Items里还是选择combobox里的某个Item,根据这个Item进行三个表的查询?
解决方案 »
- 如何确定两个程序间用何种进程间通讯
- 系统是如何生成路径的
- 做一酒店的房态图,如何在form上绘图?
- 问一个DBGridEh的问题
- 菜鸟问个初级的问题,麻烦大虾了!!
- 有一年以上三年以下工作经验的在珠海工作的程序员请进!!
- 救命啊!EDBEngine 出错啊!望高手指点迷津
- 如果让real变量只精确到小数点后三位?比如M:=0.123456,想让M:=0.123
- 高兴!送大家一点分数,高手进来拿分,100分给你先,高兴的话我会再加.
- 谁愿意作我的女朋友??
- 如何在Delphi中使用*.chm的帮助!!!
- 怎样得到系统的搜索路径或系统路径(system,web,senderto),和程序运行的路径???
注意:三个表之间必需有关联。SELECT a.a1,b.b1,c.c1
FROM a left JOIN
b ON a.id = b.id left JOIN
c ON b.id = c.id
http://www.csdn.net/expert/topic/794/794951.xml?temp=1.435488E-02
begin
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select bjxx.class from xsgl..bjxx ');
open;
first;
while not eof do
begin
combobox1.Items.Add(adoquery1.fieldbyname('class').value);
// combobox2.Items.Add(adoquery1.fieldbyname('name').value);
next;
end;
end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select xsjbxx.name from xsgl..xsjbxx');
open;
first;
while not eof do
begin
// combobox1.Items.Add(adoquery1.fieldbyname('class').value);
combobox2.Items.Add(adoquery1.fieldbyname('name').value);
next;
end;
end;
.
.
sql.add('select a.aa,b.bb,c.cc from a,b,c');
open;
first;
while not eof do
begin
combobox1.items.add( );
combobox2.items.add( );
combobox3.items.add( );
next;
end;
select table1.field1 from table1,table2,table3 where table2.field1=table1.field1 and table3.field1=table1.field1
============================================================
主要是在from 后面加上表的名称就ok了。