此外,b ...(:
我在此寻求解决方案。我每个1月和2月都有一个DBF。每个DBF中有两个列为A和B的列,A是一系列的数字,B是Vlookup,如果Columna中的值未出现在1月份的A列中,我想用" New"替换列B,反之亦然。我的代码如下:
REPLACE ALL B WITH "Old"
REPLACE ALL B WITH "New" FOR A NOT IN (sele A FROM &filejanuary)
谢谢。
上面的评论员很接近。
使用SQL Update命令...
* --- 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)
注意 - 还有一个VFP命令方法
* --- Replace ALL Feb.B with "Old" ---
SELECT February
REPLACE ALL February.B WITH "Old"
* --- Relate table January to table February through Field A ---
SELECT January
SET ORDER TO A && Assumes Index built on Jan with Expression = A
SELECT February
SET RELATION TO A INTO January
* --- Replace ALL Feb.B with "New" for No Related A in Jan ---
REPLACE ALL B WITH "New" FOR EMPTY(January.A)
祝你好运
update February set February.B = 'Old'
update February set February.B = 'New' ;
where not exists (select * from January where January.A = February.A)
select February
replace all B with iif( seek(February.A, 'January', 'JanA'), 'Old', 'New')