           reference_bases,
           LENGTH(reference_bases) AS ref_len,
           MIN(LENGTH(alternate_bases)) WITHIN RECORD AS alt_len,
+          alternate_bases,
           IF(alternate_bases IS NULL,
             FALSE,
             TRUE) AS is_variant_call,

        var_start,
        var_end,
        bin,
        reference_bases ) AS vars
ON 
  ref.chromosome = vars.chromosome
  AND ref.start = vars.var_start
ORDER BY 
  start,
  end       

SELECT
  vars.call_set_name AS sample_name,
  ref.chromosome AS chromosome,
  ref.start AS start,
  vars.var_end AS end,
  ref.reference_bases AS reference_bases,
  vars.alternate_bases AS alternate_bases,
  vars.is_variant_call AS is_variant_call,
FROM (
  SELECT  
    CONCAT('chr', Chr) AS chromosome,
