22,209
社区成员
发帖
与我相关
我的任务
分享
--这样应该就没问题了。
select * from tb
where A1=isnull(@A1,A1)
and A2=isnull(@A2,A2)
and D1=isnull(@D1,D1)
and D2=isnull(@D2,D2)
select
*
from
T1
where
A1=isnull(@A1,A1)
and
A2=isnull(@A2,A2)
and
D1=isnull(@D1,D1)
and
D2=isnull(@D2,D2)
if exists .....is null
else
.....