多表更新一表的总结 ( 积分: 100 )

B

bsense

Unregistered / Unconfirmed
GUEST, unregistred user!
困饶很久的问题终于被解决,喜,注:主要资料来自网络
多表更新一表的方法,据说有这几种:
1.三层方法
2.BetterAdo控件法
3.自己写SQL语句更新法
4.特殊SQL语句法
经过验证 方法2 好像不能正常运作
这里推荐用方法4,我门要更新Atable 的话
一般连接多表的语句是
select a.id,a.qty,b.sname,b.size from atable a,btable b
只要更改为
select a.id,a.qty,
(select top 1 b.name from btable b where b.id=a.id) as name,
(select top 1 b.size from btable b where b.id=a.id) as size
from atable a
多么简单的语法,看来做数据库要把sql学好啊
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
925
SUNSTONE的Delphi笔记
S
S
回复
0
查看
751
SUNSTONE的Delphi笔记
S
顶部