22,298
社区成员
发帖
与我相关
我的任务
分享
select a.rq,a.ontime,a.ywy,e.danwbh,e.dwmch,c.spbh,c.spmch,c.dw,c.shpchd,c.shpgg,
b.djbh,b.pihao,b.jwh,b.shl,
b.dj,b.je,b.tichml,a.kpman,b.fahuor,b.fuhr,a.username,b.sxrq,a.is_fapiao
from cwk a(nolock),ywmxk b(nolock),spkfk c(nolock),mchk e(nolock)
where a.djbh=b.djbh and a.dwbh=e.dwbh and b.spid=c.spid
and b.djbh like 'XSA'+'%'
and a.ywy like '%%'
and b.chonghdjbh like case when '%%' ='是' then '%' else '' end
and c.beactive<>'否'
and a.rq>='2010-06-01' and a.rq<='2010-06-01'
and (e.zjm like '%%' or
e.danwbh like '%%' or
e.dwmch like '%%')
order by a.djbh,a.rq
declare
@djbh char(25),
@dwmch char(45),
@chonghong char(2),
@ywy char (10),
@srq char (15),
@erq char (15)
set @djbh ='%%'
set @dwmch ='%%'
set @chonghong ='%%'
set @ywy ='%%'
set @srq ='2010-06-01'
set @erq ='2010-06-01'
select a.rq,a.ontime,a.ywy,e.danwbh,e.dwmch,c.spbh,c.spmch,c.dw,c.shpchd,c.shpgg,
b.djbh,b.pihao,b.jwh,b.shl,
b.dj,b.je,b.tichml,a.kpman,b.fahuor,b.fuhr,a.username,b.sxrq,a.is_fapiao
from cwk a(nolock),ywmxk b(nolock),spkfk c(nolock),mchk e(nolock)
where a.djbh=b.djbh and a.dwbh=e.dwbh and b.spid=c.spid
and b.djbh like 'XSA'+'%'
and a.ywy like @ywy
and b.chonghdjbh like case when @chonghong ='是' then '%' else '' end
and c.beactive<>'否'
and a.rq>=@srq and a.rq<=@erq
and (e.zjm like @dwmch or
e.danwbh like @dwmch or
e.dwmch like @dwmch)
order by a.djbh,a.rq
declare @c char(8), @v varchar(8)
set @c = '%%'
set @v = '%%'
select * from sysobjects where name like @c --> 0记录返回,相当于 like '%% '
select * from sysobjects where name like @v