SELECT [Projname],[version],[state] FROM [dbo].[Goods] WHERE 
[Projname] = CASE WHEN @Projname IS NULL THEN [Projname] ELSE @Projname END

或者

SELECT [Projname],[version],[state] FROM [dbo].[Goods] WHERE 
([Projname] = @Projname OR @Projname IS NULL
 
posted on 2020-12-28 17:40  该吃药了  阅读(291)  评论(0编辑  收藏  举报