title: How to remove condition check in the where clause statement?
body: <p>I would like to know how to use if/else or case statement in the below query or anything that could achieve the purpose.
  The idea is that, whenever a keyword is NULL or blank, I don't want to include the <code>pv.AdminPost = 1 and pv.IsStaff = 1</code> condition in the Where statement.</p>
  <p>Is there any way to do it? Thank you.</p>
  <pre><code>    ;WITH cte 
              AS (SELECT fv.Id, fv.[Description] 
                  FROM FeedView fv
                  WHERE  (fv.Id =  @PostId OR fv.[Description] LIKE '%' + @Keyword + '%' OR @Keyword IS NULL ) AND fv.ForUserId = @UserId
                  UNION 
                  SELECT pv.Id, pv.[Description]  
                  FROM PublicView pv
                  WHERE @InculdePublicPosts = 1 -- This acts as an off switch to decide whether to include public post or not.    
                        OR pv.AdminPost = 1 OR pv.IsStaff = 1 -- how to remove this condition when Keyword is NULL or empty
                        AND (pv.Id =  @PostId OR pv.[Description] LIKE '%' + @Keyword + '%' OR @keyword IS NULL )
              )
  
  SELECT cte.Id, cte.[Description]
  FROM .....
  </code></pre>