5楼代码说的问题,帖子地址:http://bbs.
*-----------------------------------------------------------------------
*-SQL命令-*
T1=SECONDS()
SELECT A,COUNT(*) 次数 FROM (SELECT A FROM SJ ;
UNION ALL SELECT B FROM SJ ;
UNION ALL SELECT C FROM SJ ;
UNION ALL SELECT D FROM SJ ;
UNION ALL SELECT E FROM SJ ;
UNION ALL SELECT F FROM SJ) A GROUP BY 1 ORDER BY 2 INTO CURSOR TMP
*------这段代码是后加的------------------------------------------
GO BOTTOM
CS=次数
SELECT DISTINCT 次数,SPACE(250) 值 FROM TMP ORDER BY 1 INTO CURSOR TMP1 READWRITE
SELECT TMP
SCAN
REPLACE 值 WITH ALLTRIM(值)+IIF(NOT EMPTY(值),[ ],[])+TMP.A FOR TMP1.次数=TMP.次数 IN TMP1
ENDSCAN
*- END
MESSAGEBOX([SQL命令运行时间:]+TRANSFORM(SECONDS()-T1)+[秒])
*-OCCURS()函数-*
CLEAR
T1=SECONDS()
SELECT A+[,]+B+[,]+C+[,]+D+[,]+E+[,]+F A FROM SJ INTO CURSOR TMP1
LOCAL LC,LNS,LCMA,LASTR[CS]
STORE [] TO LC,LASTR
SCAN
LC=LC+A+IIF(RECNO()<RECCOUNT(),[,],[])
ENDSCAN
FOR LNI=1 TO 33
LCMA=PADL(LNI,2,[0])
LNS=OCCURS(LCMA,LC)
LASTR[LNS]=LASTR[LNS]+LCMA+[ ]
ENDFOR
FOR LNI=1 TO CS
IF NOT EMPTY(LASTR[LNI])
?[〖]+PADL(LNI,3)+[〗次的号码:]+LASTR[LNI]
ENDIF
ENDFOR
MESSAGEBOX([OCCURS()函数运行时间:]+TRANSFORM(SECONDS()-T1)+[秒])
[
本帖最后由 sdta 于 2014-3-24 01:05 编辑 ]