declare @userid int
--set @userid=800
select * from users where (isnull(@userid,1)=1 or userid=@userid)
declare @userid int
--set @userid=800
select * from users where (isnull(@userid,1)=1 or userid=@userid)
转载于:https://www.cnblogs.com/BlogNetSpace/articles/1215067.html