title: Same values in MySQL not being grouped
body: <p>I have two columns in two separate tables (both varchar(45)) and they both have values such as 0123456.</p>
  
  <p>I have a union query which basically stacks the rows from both tables.</p>
  
  <pre><code>select 
  'ISSUED' AS action,
  card_match_key AS card_match_key,
  count(0) AS CNT
  from
  dim_consumer_cards
  group by 1 , 2 
  
  union 
  
  select 
  'REDEEMED' AS action,
  card_match_key AS card_match_key,
  count(0) AS CNT
  from
  fct_card_redemptions
  group by 1 , 2
  </code></pre>
  
  <p>Then a second query which forms a crosstab on the stacked data.</p>
  
  <pre><code>Select
  card_match_key as cardkey,
  sum(case when action = 'ISSUED' then CNT else 0 end) as ISSUED,
  sum(case when action = 'REDEEMED' then CNT else 0 end) as REDEEMED
  from vw_rpt_matchkey1
  group by 
  card_match_key
  </code></pre>
  
  <p>My issue/question is that my values are not being grouped on like values (e.g. 0123456).
  Each value should only appear on a single row, but I'm getting two rows.</p>