VF中 表之间的关联

2025-05-09 04:14:56
推荐回答(2个)
回答1:

"那么把b里相对应的序号的地址放到a.dbf里。 "
???
这样不好,会破坏a.dbf结构.
最好放到其它的表里c.dbf,
用这个命令:

select a.编号 a.产品 b.地址 from a b where a.编号=b.编号 into table c.dbf

回答2:

1,给A表添加地址列
alter table a add 地址 char(20);
2,根据b表更新a表的地址
update a set 地址=(select 地址 from b where a.编号=b.编号) where exists (select 1 from b where a.编号=b.编号);