注册 登录
编程论坛 VFP论坛

不想保留表

tjdeming 发布于 2023-10-10 21:24, 542 次点击
程序代码:
****找出两个表中的不同记录***vfp6.0
SET SAFET OFF
create tabl aa (xh n(4))
insert into aa values(1001)
insert into aa values(1002)
insert into aa values(1003)
insert into aa values(1005)
insert into aa values(2005)

create tabl bb (xh n(4))
insert into bb values(1001)
insert into bb values(1002)
insert into bb values(1003)
insert into bb values(1004)
insert into bb values(2008)

create tabl bdxh(表名 c(10),xh N(4),备注 c(10))
SELE "AA表" AS 表名,xh,"BB表无" as 备注 from aa where xh not in(sele xh from bb) into tabl AAXH
SELE "BB表" AS 表名,xh,"AA表无" as 备注 from bb where xh not in(sele xh from aa) into tabl BBXH
sele bdxh
append from  AAXH
append from  bbXH
brow
copy to bdxh type xls
说明:aa,bb 是原始数据表,该程序得到bdxm.xls后,所在的文件夹里不想产生bdxh、aaxh、bbxh 三个dbf表 有没有好的办法。
6 回复
#2
csyx2023-10-10 22:17
...
create cursor bdxh(表名 c(10),xh N(4),备注 c(10))
SELE "AA表" AS 表名,xh,"BB表无" as 备注 from aa where xh not in(sele xh from bb) into cursor AAXH
SELE "BB表" AS 表名,xh,"AA表无" as 备注 from bb where xh not in(sele xh from aa) into cursor BBXH
sele bdxh
append from  dbf('AAXH')
append from  dbf('bbXH')
brow
copy to bdxh type xls
use in select('bdxh')
use in select('AAXH')
use in select('BBXH')


#3
tjdeming2023-10-10 22:42
回复 2楼 csyx
只有本站会员才能查看附件,请 登录
#4
csyx2023-10-10 22:54
这么简单的问题都不知道是什么原因吗?
#5
tjdeming2023-10-10 22:55
回复 2楼 csyx
试用了,能实现!谢谢你
#6
wengjl2023-10-20 13:28
create table aa(....)   创建的表默认是打开状态,所以会提示 别名被占用。
#7
tjdeming2023-10-20 18:14
回复 6楼 wengjl
谢谢你!我记住了
1