表一 : ID , webtel , hometel , type
表二 : ID , hometel , address
表三 : ID , type , money
表四 : ID , webte , hometel , address , type , money
表二和表一 用hometel关联
表三和表一用type 关联按下button1按纽表一表二表三的记录都会写入表四中以前是这样写的
insert into t4(ID , webte , hometel , address , type , money)
select t1.id, t1.webte, t1.hometel, t2.address, t3.type, t3.money from t1,t2,t3 where t1.hometel = t2.hometel and t1.type = t3.type但上面那样的话所有的记录都生成到表四中了,现在想要改成选取DBGrid中的一行或多行有选择性的生成!这样怎么办?
表二 : ID , hometel , address
表三 : ID , type , money
表四 : ID , webte , hometel , address , type , money
表二和表一 用hometel关联
表三和表一用type 关联按下button1按纽表一表二表三的记录都会写入表四中以前是这样写的
insert into t4(ID , webte , hometel , address , type , money)
select t1.id, t1.webte, t1.hometel, t2.address, t3.type, t3.money from t1,t2,t3 where t1.hometel = t2.hometel and t1.type = t3.type但上面那样的话所有的记录都生成到表四中了,现在想要改成选取DBGrid中的一行或多行有选择性的生成!这样怎么办?
解决方案 »
- 这个函数如果怎么用?其中的ix,iy是什么?可不可以改为按钮代码?
- 这样的功能用什么控件做比较合适?
- 超级新手 求助 delphi中的返回 (50分)
- INDY9.0.18如何安装啊?有没有DX能帮忙写一个安装的教材啊!有多少分就给多少!
- 告别csdn,散分!只有这么多分了
- 关于过滤关键字敏感字的问题,征集解决方案!
- [Delphi编程驿站]祝愿所有DELPHI爱好者中秋佳节快乐!
- 怎么算一个Tdatetime的后一天? 在线等待
- Invalid Variant type Conversion--在线
- 同样一个存储过程,为什么第一次快,第二次就很慢?
- 如何访问单个网格的Color属性,也就是Font属性?(不要嫌分少)
- 请问能动态添加字段吗?
select t1.id, t1.webte, t1.hometel, t2.address, t3.type, t3.money from t1,t2,t3 where t1.hometel = t2.hometel and t1.type = t3.type
And T1.Id= 選擇的條件或者
insert into t4(ID , webte , hometel , address , type , money)
select t1.id, t1.webte, t1.hometel, t2.address, t3.type, t3.money from t1,t2,t3 where t1.hometel = t2.hometel and t1.type = t3.type
And T1.Id in( 選擇的條件1,..)
select a.id, a.webtel, a.hometel, b.address, c.type, c.money
from t1 a inner join t2 b on a.hometel = b.hometel
inner join t3 c on a.type = c.type
select a.id, a.webtel, a.hometel, b.address, c.type, c.money
from t1 a
inner join t2 b
on a.hometel = b.hometel
left join t3 c on a.type = c.type
select t1.id, t1.webte, t1.hometel, t2.address, t3.type, t3.money from t1,t2,t3 where t1.hometel = t2.hometel and t1.type = t3.type and t1.id=3
就是直接在后面加条件就是了