回复 2楼 sdta
谢谢版主回复,进一步请教:
程序代码:
Create table b1 (jnh n(2),m1 c(2),m2 c(2),mt c(2))
insert into b1 values (1,"M1","","")
insert into b1 values (2,"","M2","")
insert into b1 values (3,"M1","","")
insert into b1 values (4,"M1","M2","")
insert into b1 values (5,"","M2","")
USE b1 IN 0 ALIAS t1 AGAIN
USE b1 IN 0 ALIAS t2 AGAIN
SELECT t1
SET RELATION TO RECNO()+1 INTO "t2"
SELECT t1
REPLACE ALL ;
t2.mt with IIF(!EMPTY(t1.m1) and !EMPTY(t2.m1) OR ;
!EMPTY(t1.m2) and !EMPTY(t2.m2) ,'MT',"")
SET RELATION TO
brow
在这段代码中能否改为如下通用模式:
程序代码:
USE b1 IN 0 ALIAS t1 AGAIN
USE b1 IN 0 ALIAS t2 AGAIN
SELECT t1
SET RELATION TO RECNO()+1 INTO "t2"
SELECT t1
REPLACE ALL ;
t2.mt with IIF(!EMPTY(t1.k1) and !EMPTY(t2.k1) OR ;
!EMPTY(t1.k2) and !EMPTY(t2.k2) ,'MT',"")
SET RELATION TO
brow
即k1=m1
k2=m2
也可表示其他字段
应如何写?谢谢!