title: How to union two case statement columns
body: <p>I've created 2 case statements to pull data from a single table (it's been created as 2 separate case statements as I want to double count values and as a single case statement, it did not do this).  </p>
  
  <p>The 2 case statements have resulted in 2 new columns of data (case statement A and case statement B).  However, I'd like the 2 case statement values to be reported in a single column, so I'm trying to find a way to union these 2 columns together.  </p>
  
  <p>Here is my query as it stands.  I'm very new to SQL (just over a week!) so please excuse any silly syntax in my query.</p>
  
  <pre><code>select b.part_month, count(a.pay_code), sum(a.amount),
  CASE
  when a.pay_code like 'CC%' THEN 'Credit Card Payment'
  when a.pay_code like 'DC%' then 'Debit Card Payment'
  Else 'N/A'
  End as Payment_Type,
  
  CASE
  when a.pay_code like '%IP%' then 'Internet Payment'
  when a.pay_code like '%TT%' then 'Touchtone Payment'
  Else 'N/A'
  End as Payment_Type
  
  from table_a A
  inner join table_b B on A.form_ID = B.ID
  where a.trans_type &gt; 0
  and b.st_id = 2
  
  group by B.PART_MONTH,
  CASE
  when a.pay_code like 'CC%' THEN 'Credit Card Payment'
  when a.pay_code like 'DC%' then 'Debit Card Payment'
  Else 'N/A'
  End,
  
  CASE
  when a.pay_code like '%IP%' then 'Internet Payment'
  when a.pay_code like '%TT%' then 'Touchtone Payment'
  Else 'N/A'
  End
  order by b.part_month asc;
  </code></pre>