关于DELETE - SQL 命令的问题
如同在UPDATE - SQL 命令中遇到的问题一样,在DELETE - SQL 命令中同样遇到。SET TALK OFF
SET SAFETY OFF
SET CENTURY ON
SET EXACT ON
SET DATE YMD
SET SYSMENU OFF
CLEAR ALL
CLOSE DATABASES
CD D:\BDS
CREATE DBF L1 (A1 C(10), A2 C(10),A3 N(2)) &&建立表
FOR X=1 TO 8
Y=STR(X,1)
APPEND BLANK
REPLACE A1 WITH 'SJA'+Y,A2 WITH 'SJB'+Y,A3 WITH X
ENDFOR
COPY TO L2 FOR A3<6
INDEX ON A3 TAG A1
SELECT 0
USE L2
DELETE FOR A3=3
PACK
INDEX ON A3 TAG A1
SELECT L1
SET RELATION TO A3 INTO L2
DELETE FROM L1 WHERE L1.A3=L2.A3
*DELETE FOR L1.A3=L2.A3
BROWSE
RETURN
程序段是想在L1表中,删除L2表有的记录,关键字段是A3。但是上述程序只能删除第一条记录。采用 DELETE FOR L1.A3=L2.A3 是能达到目的的。为什么?