* 在VFP 9.0中测试结果
IF USED("彩票")
SELECT 彩票
ELSE
USE 彩票 IN 0
ENDIF
* 生成测试数据,只用了10秒
LOCAL i
*!*
i=1
*!*
RAND(-1)
*!*
FOR i=11 TO 1100000
*!*
INSERT INTO 彩票 VALUES (i,PADL(CEILING(RAND()*33),2,"0"),PADL(CEILING(RAND()*33),2,"0"), ;
*!*
PADL(CEILING(RAND()*33),2,"0"),PADL(CEILING(RAND()*33),2,"0"), ;
*!*
PADL(CEILING(RAND()*33),2,"0"),PADL(CEILING(RAND()*33),2,"0"), ;
*!*
PADL(CEILING(RAND()*33),2,"0"), "")
*!*
ENDFOR
*!*
BROWSE
* win7 32 4G内存,双核2.4,
3分钟都内出结果
* 为了去除公式计算,去掉了 EVALUATE()
LOCAL h1,h2,h3,s1
*!*
s1=SECONDS()
*!*
SCAN
*!*
STORE 0 TO h1,h2,h3
*!*
h1 = h1 + IIF(BETWEEN(红球1,'01','11'),1,0) + ;
*!*
IIF(BETWEEN(红球2,'01','11'),1,0) + ;
*!*
IIF(BETWEEN(红球3,'01','11'),1,0) + ;
*!*
IIF(BETWEEN(红球4,'01','11'),1,0) + ;
*!*
IIF(BETWEEN(红球5,'01','11'),1,0) + ;
*!*
IIF(BETWEEN(红球6,'01','11'),1,0)
*!*
h2 = h2 + IIF(BETWEEN(红球1,'12','22'),1,0) + ;
*!*
IIF(BETWEEN(红球2,'12','22'),1,0) + ;
*!*
IIF(BETWEEN(红球3,'12','22'),1,0) + ;
*!*
IIF(BETWEEN(红球4,'12','22'),1,0) + ;
*!*
IIF(BETWEEN(红球5,'12','22'),1,0) + ;
*!*
IIF(BETWEEN(红球6,'12','22'),1,0)
*!*
h3 = h3 + IIF(BETWEEN(红球1,'23','33'),1,0) + ;
*!*
IIF(BETWEEN(红球2,'23','33'),1,0) + ;
*!*
IIF(BETWEEN(红球3,'23','33'),1,0) + ;
*!*
IIF(BETWEEN(红球4,'23','33'),1,0) + ;
*!*
IIF(BETWEEN(红球5,'23','33'),1,0) + ;
*!*
IIF(BETWEEN(红球6,'23','33'),1,0)
*!*
REPLACE 段比 WITH STR(h1,1)+":"+STR(h2,1)+":"+STR(h3,1)
*!*
ENDSCAN
*!*
?SECONDS()-s1
*!*
*!*
BROWSE
* win7 32 4G内存,双核2.4,大概60秒
s1=SECONDS()
update a set a.段比=b.段比 from 彩票 as a ;
inner join (select 序号,红球1,红球2,红球3,红球4,红球5,红球6,篮球, ;
tran(iif(between(红球1 ,'01','11'),1,0) + ;
iif(between(红球2 ,'01','11'),1,0) + ;
iif(between(红球3 ,'01','11'),1,0) + ;
iif(between(红球4 ,'01','11'),1,0) + ;
iif(between(红球5 ,'01','11'),1,0) + ;
iif(between(红球6 ,'01','11'),1,0)) + ":" +
;
tran(iif(between(红球1 ,'12','22'),1,0) + ;
iif(between(红球2 ,'12','22'),1,0) + ;
iif(between(红球3 ,'12','22'),1,0) + ;
iif(between(红球4 ,'12','22'),1,0) + ;
iif(between(红球5 ,'12','22'),1,0) + ;
iif(between(红球6 ,'12','22'),1,0)) + ":" +
;
tran(iif(between(红球1 ,'23','33'),1,0) + ;
iif(between(红球2 ,'23','33'),1,0) + ;
iif(between(红球3 ,'23','33'),1,0) + ;
iif(between(红球4 ,'23','33'),1,0) + ;
iif(between(红球5 ,'23','33'),1,0) + ;
iif(between(红球6 ,'23','33'),1,0)) as 段比 ;
from 彩票) as b ;
on a.序号=b.序号
?SECONDS()-s1
BROWSE