clear
*表1
CREATE CURSOR 表1(序号 INT,结果 C(10))
INSERT INTO 表1(序号,结果) VALUES(1,'05601')
INSERT INTO 表1(序号,结果) VALUES(2,'47896')
INSERT INTO 表1(序号,结果) VALUES(3,'81222')
INSERT INTO 表1(序号,结果) VALUES(4,'48068')
INSERT INTO 表1(序号,结果) VALUES(5,'54969')
*表2
CREATE CURSOR 表2(序号 INT,结果 C(10),包含 C(2))
INSERT INTO 表2(序号,结果) VALUES(1,'005')
INSERT INTO 表2(序号,结果) VALUES(2,'048')
INSERT INTO 表2(序号,结果) VALUES(3,'128')
INSERT INTO 表2(序号,结果) VALUES(4,'379')
INSERT INTO 表2(序号,结果) VALUES(5,'468')
select 表2
GO TOP
SCAN
JG=ALLTRIM(结果)
XH=序号
BH='否'
cWhere=''
FOR I=1 TO LEN(JG)
cWhere=IIF(EMPTY(cWhere),"结果 LIKE "+"'%'+'"+SUBSTR(JG,I,1)+"'+'%'",cWhere+" and 结果 LIKE "+"'%'+'"+SUBSTR(JG,I,1)+"'+'%'")
ENDFOR
cCmd="SELECT * FROM 表1 where "+cWhere+" and 序号=XH INTO CURSOR TMP"
?cCmd
SL=SELECT()
EXECSCRIPT(cCmd)
IF RECCOUNT()>0
SELECT (SL)
REPLACE 包含 WITH "是"
ENDIF
ENDSCAN
SELECT (SL)
BROWSE