以下是引用chychychy在2019-6-26 17:24:08的发言:
厉害,刚刚学习也测试了,不好意思因为平时不用,所以没看懂,麻烦解释一下,尤其 SELECT部分,确实高明,我好学习排列其他组合。发现我不懂的地方实在太多了
再请教,如何将临时表中数据写回“等级库”表中六科字段(请勿见笑)
给你一个不用SELECT语句处理等级的程序。
CLEAR
CREATE TABLE 等级库 (a1 c(1),a2 c(1),a3 c(1),A4 C(1),A5 C(1),A6 C(1),A7 C(1),ZDJ C(7),PXDJ C(7))
FOR j1=1 TO 5
FOR j2=1 TO 5
FOR j3=1 TO 5
FOR j4=1 TO 5
FOR j5=1 TO 5
FOR j6=1 TO 5
FOR j7=1 TO 5
APPEND BLANK
REPLACE A1 WITH CHR(64+J1),A2 WITH CHR(64+J2),A3 WITH CHR(64+J3)
REPLACE A4 WITH CHR(64+J4),A5 WITH CHR(64+J5),A6 WITH CHR(64+J6)
REPLACE A7 WITH CHR(64+J7),ZDJ WITH A1+A2+A3+A4+A5+A6+A7
REPLACE PXDJ WITH DJPX(ZDJ)
NEXT
NEXT
NEXT
NEXT
NEXT
NEXT
NEXT
INDEX ON PXDJ TO LS UNIQ
COPY TO 等级库_唯一不重复
USE 等级库_唯一不重复
BROWSE
USE
RETURN
FUNCTION djpx(cStr)
LOCAL px[LEN(cStr)]
FOR i = 1 TO LEN(cStr)
px[i] = SUBSTR(cStr, i, 1)
ENDFOR
=ASORT(px)
cStr1 = ""
FOR i = 1 TO ALEN(px,1)
cStr1 = cStr1 + px[i]
ENDFOR
RETURN cStr1