取得日期:
repl ls with substr(certid,11,4) for len(alltrim(certid))=18
brow
repl ls with substr(certid,9,4) for len(alltrim(certid))=15
modi stru
repl all ls1 with left(ls,2)+'月'+right(ls,2)+'日'
case 语句:
select b.servnumber,
case when a.privid=75900000062422 then ''
when a.privid=75900000062423 then ''
when a.privid=75900000062424 then ''
when a.privid=75900000062425 then ''
end
from zjzw.cm_Subs_Privilege a join zjzw.cm_subs_subscriber b on a.subsid=b.subsid
where a.privid in (75900000062422,75900000062423,75900000062424,75900000062425)
压缩语句:
delete for substr(dhhm,1,1)!='1'
向表中加入记录程序:
set safe off
sele a
use ls
zap
pack
index on dhhm to s
sele b
use bb_hf_610
go top
do while .not. eof()
aa=dhhm
sele a
seek aa
if found()
repl hf_610 with b->to_hf
else
appe blank
repl dhhm with aa
repl hf_610 with b->to_hf
endif
sele b
skip
enddo
显示目录:
dir.*或dir
case等效语句:
repla all stopkey with ''for stopkey='00020000'
repla all stopkey with ''for stopkey='00002000'
repla all stopkey with ''for stopkey='20000000'
repla all stopkey with ''for stopkey='02000000'
repla all stopkey with ''for stopkey='00200000'
求和过程中消除零情况处理;
iif(isnull(a.amt),0,a.amt);
多表连接求和(同一号码):
select a.dhhm,iif(isnull(a.to_hf ),0,a.to_hf )+b.to_hf+c.to_hf+d.to_hf+e.to_hf+f.to_hf as avgconsume ;
FRom bb_hf_703_bk a left join bb_hf_702_bk b on a.dhhm=b.dhhm left join bb_hf_701_bk c on a.dhhm=c.dhhm ;
left join bb_hf_612_bk d on a.dhhm=d.dhhm left join bb_hf_611 e on a.dhhm=e.dhhm left join bb_hf_610 f on a.dhhm=f.dhhm
.dbf文件转换成.txt文件:
appe from filename.txt sdf