title: Sql Server WHERE IN with CASE
body: <p>How can we specify range of values from CASE inside WHERE clause?<br>
  This query of mine fails</p>
  
  <pre><code>declare @ProductType int
  
  select * from Products 
  where ProductLine in 
  (
      case @ProductType
          when 1 then ('TVs')
          when 2 then ('Handsets', 'Mobiles') --fails here
          else ('Books')
      end
  )
  </code></pre>
  
  <p>This wouldn't work either:</p>
  
  <pre><code>declare @ProductType int
  
  select * from Products 
  where (case @ProductType 
               when 1 then (ProductLine = 'TVs')
               when 2 then (ProductLine in  ('Handsets', 'Mobiles'))
               else (ProductLine = 'Books')
         end)
  </code></pre>