title: Combine three columns from different tables into one row
body: <p>I am new to sql and are trying to combine a column value from three different tables and combine to one row in DB2 Warehouse on Cloud. Each table consists of only one row and unique column name. So what I want to is just join these three to one row their original column names.</p>
  
  <p>Each table is built from a statement that looks like this:</p>
  
  <pre><code>SELECT SUM(FUEL_TEMP.FUEL_MLAD_VALUE) AS FUEL 
  FROM
      (SELECT ML_ANOMALY_DETECTION.MLAD_METRIC AS MLAD_METRIC, ML_ANOMALY_DETECTION.MLAD_VALUE AS FUEL_MLAD_VALUE, ML_ANOMALY_DETECTION.TAG_NAME AS TAG_NAME, ML_ANOMALY_DETECTION.DATETIME AS DATETIME, DATA_CONFIG.SYSTEM_NAME AS SYSTEM_NAME
       FROM ML_ANOMALY_DETECTION 
           INNER JOIN DATA_CONFIG ON 
                 (ML_ANOMALY_DETECTION.TAG_NAME  =DATA_CONFIG.TAG_NAME AND 
                  DATA_CONFIG.SYSTEM_NAME = 'FUEL') 
       WHERE ML_ANOMALY_DETECTION.MLAD_METRIC = 'IFOREST_SCORE'
         AND ML_ANOMALY_DETECTION.DATETIME &gt;= (CURRENT DATE - 9 DAYS) 
       ORDER BY DATETIME DESC)
  AS FUEL_TEMP
  </code></pre>
  
  <p>I have tried JOIN, INNER JOIN, UNION/UNION ALL, but can't get it to work as it should. How can I do this?</p>