且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在where子句中提高条件.

更新时间:2022-06-03 18:03:40

也许以下条件会有所帮助
Perhaps the following condition would help
where BusinessStatus =1 and
(
  (BusinessName Like  @BusinessName + ''%'' and @BusinessName  is not null)
  or
  (BusinessDescription Like  @BusinessDescription + ''%'' and @BusinessDescription is not null)
)


而且您不再需要if(@BusinessName is not null and @BusinessDescription is null)


And you dont need the if(@BusinessName is not null and @BusinessDescription is null) anymore