日期:2014-05-16 浏览次数:20477 次
select COUNT(*) from jobnotable with(nolock)
if @@ROWCOUNT =0
select
a.*
from
JobMain a with(nolock),
JobDetail b with(nolock)
where
a.id = b.id
else
select
a.*
from
JobMain a with(nolock),
JobDetail b with(nolock),
jobnotable c with(nolock)
where
a.id = b.id
and b.jobno=c.jobno
declare @rowcount int
set @rowcount=0
select @rowcount=COUNT(*) from jobnotable with(nolock)
if @ROWCOUNT =0
select
a.*
from
JobMain a with(nolock),
JobDetail b with(nolock)
where
a.id = b.id
else
select
a.*
from
JobMain a with(nolock),
JobDetail b with(nolock),
jobnotable c with(nolock)
where
a.id = b.id
and b.jobno=c.jobno