title: Multiple conditions with CASE statements
body: <p>I need to query some data. here is the query that i have constructed but which isn't workig fine for me. For this example I am using AdventureWorks database.</p>
  
  <pre><code>SELECT * FROM [Purchasing].[Vendor] WHERE PurchasingWebServiceURL LIKE 
  case
  // In this case I need all rows to be returned if @url is '' or 'ALL' or NULL
   when (@url IS null OR @url = '' OR @url = 'ALL') then ('''%'' AND PurchasingWebServiceURL IS NULL')
  //I need all records which are blank here including nulls
           when (@url = 'blank') then (''''' AND PurchasingWebServiceURL IS NULL' )
  //n this condition I need all record which are not like a particular value
           when (@url = 'fail') then ('''%'' AND PurchasingWebServiceURL NOT LIKE ''%treyresearch%''' )
  //Else Match the records which are `LIKE` the input value
           else '%' + @url + '%' 
      end
  </code></pre>
  
  <p>This is not working for me. How can I have multiple where condition clauses in the <code>THEN</code> of the the same <code>CASE</code>? How can I make this work?</p>