title: Is there a way in SQL server to apply case statement to multiple columns?
body: <p>I am looking to apply a CASE condition to multiple columns simultaneously. And, if possible, for multiple tables as well. I know it is  possible to replicate the code, but as there are many columns I though there might be a more efficient way.</p>
  <p>Example:</p>
  <pre><code>SELECT
  CASE COLUMN1, COLUMN2, COLUMN3, COLUMN4
  WHEN 1 THEN 0
  WHEN 2 THEN 1
  WHEN 3 THEN 2
  WHEN 4 THEN 3
  WHEN 5 THEN 4
  WHEN 6 THEN 5
  WHEN 7 THEN 6
  WHEN 8 THEN 7
  WHEN 99 THEN NULL
  END AS COLUMN1, COLUMN2, COLUMN3, COLUMN4
  FROM TABLE1
  </code></pre>
  <p>And if possible, do the same procedure for TABLE2, TABLE3, etc ...</p>
  <p>EDIT: The value in the columns are codes representing the number of days the user is online in each application in a platform. So what I'm intending to do is sum those values to get to the total days online. The value 1 represents 0 days online, 2 represents 1 day online and so on. So I need to change those to the actual number of days.</p>
  <p>Thank you!</p>