title: Using CASE in PostgreSQL to affect multiple columns at once
body: <p>I have a Postgres <code>SELECT</code> statement with these expressions:</p>
  
  <pre><code>,CASE WHEN (rtp.team_id = rtp.sub_team_id)
   THEN 'testing'
   ELSE TRIM(rtd2.team_name)
   END AS testing_testing
  ,CASE WHEN (rtp.team_id = rtp.sub_team_id)
   THEN 'test example'
   ELSE TRIM(rtd2.normal_data)
   END AS test_response
  ,CASE WHEN (rtp.team_id = rtp.sub_team_id)
   THEN 'test example #2'
   ELSE TRIM(rtd2.normal_data_2)
   END AS another_example
  </code></pre>
  
  <p>In my particular query there are 5 fields whose output depends on whether <code>rtp.team_id = rtp.sub_team_id</code> evaluates true. I'm repeating <code>CASE</code> statements with the same condition over and over.</p>
  
  <p>Is there any way I can combine these <code>CASE</code> expressions to toggle the output of multiple columns in one shot?</p>