求助set filter to 速度慢(附命令行)
大家好,请看下面命令最后一条,set filter to 语名, 刚开始因为数据少用用还可以, 现在数据多了用了这个命令查询速度太慢了。 select ck_cp_op
set order to bm_bh
select ck_cp_o
set relation to bm_bh into ck_cp_op
l_tj1 = 'ck_cp_o.ck_date>=ctod(l_ckd1) and ck_cp_o.ck_date<=ctod(l_ckd2)'
if l_ckbh==''
else
l_tj1 = l_tj1+' .AND. alltrim(ck_cp_o.bm_bh)=l_ckbh'
endi
if l_ckfs==''
else
l_tj1 = l_tj1+' .AND. alltrim(ck_cp_o.ck_what)=l_ckfs'
endi
if l_ckbuy==''
else
l_tj1 = l_tj1+' .AND. alltrim(ck_cp_o.dw_buy)=l_ckbuy'
endi
select ck_cp_o
set filter to &l_tj1 ***有条件的进行查询表中的数据