title: sql: combine two tables around timestamp
body: <p>I have two tables with sensor data and I want to combine both tables into one.</p>
  
  <p>Table 1:</p>
  
  <pre><code>Sensor1 | Timestamp
  34        2018-22-05 23:23:34
  25        2018-22-05 22:23:23
  51        2019-22-05 12:34:56
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>Sensor2 | Timestamp
  27        2018-22-05 23:37:33
  29        2018-22-05 22:36:47
  66        2019-22-05 12:34:56
  </code></pre>
  
  <p>And my desired result is:</p>
  
  <p>Expected Table:</p>
  
  <pre><code>Sensor1 | Sensor2 | Timestamp
            27        2018-22-05 23:37:33
  34                  2018-22-05 23:23:34
            29        2018-22-05 22:36:47
  25                  2018-22-05 22:23:23
  51        66        2019-22-05 12:34:56
  </code></pre>
  
  <p>It is very unlikely that we could have the same timestamp in both tables, but even if we do, it shouldn't be a problem to have values in both Sensor colums.</p>
  
  <p>I have tried with UNION, UNION ALL, OUTER JOIN, but I always end up with two timestamp columns.</p>
  
  <p>Has anybody an idea?</p>
  
  <p>Thanks and best regards,
  Rodrigo.</p>