引入数据时,更新数据的问题?
有多个子表,一个总表,子表和总表的结构相同。每个表中均有“身份证号(sfzh)”字段。
我想问:如果将子表中的数据合并到总表中,如果sfzh 相同则替换原有字段,如果不同则添加本条记录。
如何操作?
inse into 子表 sele * from 总表 where !( sfzh in(sele sfzh from 子表) ) use in 总表 sele * from 子表 orde by sfzh into tabl 总表
sele * from 总表 where !( sfzh in(sele sfzh from 子表) ) into tabl tmp sele 总表 zap appe from tmp appe from 子表