我在此寻求解决方案。我每月1月和2月都有一个dbf。每个dbf中有两列名为A和B,A是一系列数字,B是vlookup,我想在2月用" new"替换columnB。如果它在columnA中的值没有出现在1月的A列中,而且#34; old"反之亦然。我的代码如下:
REPLACE ALL B WITH "Old"
REPLACE ALL B WITH "New" FOR A NOT IN (sele A FROM &filejanuary)
感谢。
答案 0 :(得分:2)
上述评论员很接近 使用SQL UPDATE命令...
// A.h
#include <array>
using namespace std;
constexpr int LENGTH{10};
class A {
array<int,LENGTH> internalArray;
public:
const static int LENGTH;
};
注意 - 还有一个VFP命令方法
* --- Replace ALL Feb.B with "Old" ---
UPDATE February SET February.B = 'Old'
* --- Now change Feb.B to "New" for Applicable Conditions ---
UPDATE February SET February.B = 'New' ;
WHERE February.A NOT IN (SELECT A FROM January)
祝你好运
答案 1 :(得分:0)
update February set February.B = 'Old'
update February set February.B = 'New' ;
where not exists (select * from January where January.A = February.A)
答案 2 :(得分:0)
此外,如果你想使用xBase,那么如果1月份有一个索引就更简单了.A(假设它的标签是JanA - 谁真的将字段命名为A,B ......): / p>
select February
replace all B with iif( seek(February.A, 'January', 'JanA'), 'Old', 'New')