title: Merging UNION ALL rows to remove NULL values
body: <pre><code>SELECT journey.id, TIME_FORMAT(ADDTIME(journey.departure, SEC_TO_TIME(SUM(l1.elapsed))), '%H:%i') AS departure, null AS arrival
  FROM journey
  INNER JOIN journey_day ON journey_day.journey = journey.code
  INNER JOIN pattern ON pattern.code = journey.pattern
  INNER JOIN link l1 ON l1.section = pattern.section AND l1.stop = "370023139"
  INNER JOIN link l2 ON l2.section = pattern.section AND l2.id &lt;= l1.id
  WHERE journey.service = "11-252-_-y08-1" AND journey_day.day = 1 AND journey.code NOT IN (SELECT journey
                                                                                            FROM journey_non_operation
                                                                                            WHERE "2015-03-01" BETWEEN date_start AND date_end) AND pattern.direction = "outbound"
  GROUP BY journey.id
  
  UNION ALL
  
  SELECT journey.id, null AS departure, TIME_FORMAT(ADDTIME(journey.departure, SEC_TO_TIME(SUM(l1.elapsed))), '%H:%i') AS arrival
  FROM journey
  INNER JOIN journey_day ON journey_day.journey = journey.code
  INNER JOIN pattern ON pattern.code = journey.pattern
  INNER JOIN link l1 ON l1.section = pattern.section AND l1.stop = "1000DEHS7812"
  INNER JOIN link l2 ON l2.section = pattern.section AND l2.id &lt;= l1.id
  WHERE journey.service = "11-252-_-y08-1" AND journey_day.day = 1 AND journey.code NOT IN (SELECT journey
                                                                                            FROM journey_non_operation
                                                                                            WHERE "2015-03-01" BETWEEN date_start AND date_end) AND pattern.direction = "outbound"
  GROUP BY journey.id
  </code></pre>
  
  <p>Above is two queries with their results merged by a UNION ALL clause. You will notice that the queries return different columns, one called 'departure' and one called 'arrival'. To get the <code>UNION</code> to work with the different column names I have to give the other column <code>NULL</code> so that it doesn't ignore it and not include it in the query.</p>
  
  <p>My issue is I have results that looks like this:</p>
  
  <p><code>id | departure | arrival</code><br>
  <code>1       asd        NULL</code><br>
  <code>2       asd        NULL</code><br>
  <code>3       asd        NULL</code><br>
  <code>4       asd        NULL</code><br>
  <code>5       NULL        efg</code><br>
  <code>6       NULL        efg</code><br>
  <code>7       NULL        efg</code><br>
  <code>8       NULL        efg</code>  </p>
  
  <p>How can I merge the rows so that <code>asd</code> and <code>efg</code> match up based on the ID?</p>
  
  <p>Desired result: </p>
  
  <p><code>id | departure | arrival</code><br>
  <code>1       asd        efg</code><br>
  <code>2       asd        efg</code><br>
  <code>3       asd        efg</code><br>
  <code>4       asd        efg</code> </p>