title: IF value is in list set value in next column NULL
body: <p>I have a huge SQL table and need to filter several columns (called <code>Field</code>) if they are in this list:</p>
  
  <pre><code>AAA, BBB, CCC, DDD, EEE
  </code></pre>
  
  <p>If this is the case, set respective <code>value</code> column to NULL.</p>
  
  <p>Let me give you an example table:</p>
  
  <pre><code>Field1  Value1  Field2  Value2 ...... Field10  Value10
    AAA     9A      AAA     9A            CCC       World    
    BBB     1       KKK     0    
    ZZZ     9       AAA     9A            CCC       42      
    CCC     7
    LLL     9       AAA     3             III       98     
    KKK     3       AAA     4    
    DDD     100     AAA     Hello         CCC       6  
  </code></pre>
  
  <p>Not all Field Value combinations are filled up until <code>Value10</code>. However every column that is named <code>FieldXX</code> must be checked for the list entries. If a cell is equal to a list entry the respective value field should be set NULL. Otherwise the value field remains untouched.</p>
  
  <p>I struggle to figure out the correct <code>CASE</code> statement for this specific issue. I tried the following code:</p>
  
  <pre><code>SELECT CAST(
               CASE 
                    WHEN Field* = AAA or BBB or CCC or DDD or EEE 
                       THEN Value* = 0
                    ELSE Value* = Value*
               END AS bit)
  FROM dbo.Log
  </code></pre>
  
  <p>But this query totally fails and it might not be for specific field-value pairs.</p>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>Field1  Value1  Field2  Value2 ...... Field10  Value10
    AAA     0       AAA     0            CCC       0    
    BBB     0       KKK     0    
    ZZZ     9       AAA     0            CCC       0      
    CCC     0
    LLL     9       AAA     0            III       98     
    KKK     3       AAA     0    
    DDD     0       AAA     0            CCC       0 
  </code></pre>
  
  <p>Table name is <code>dbo.Log</code>.</p>