title: how to get maximum value of two fields from two different tables in ORACLE
body: <p>I have a process which prints log in two tables depending of success or failure:</p>
  
  <pre><code>log_mig
  log_mig_error
  </code></pre>
  
  <p>and I want to get the maximum of two fields with the same name:</p>
  
  <pre><code>uid_proc
  </code></pre>
  
  <p>for adding the consecutive of the current process, this is the query I made so far:</p>
  
  <pre><code>(SELECT MAX(uid_proc) FROM LOG_MIG) UNION ALL (SELECT MAX(uid_proc) FROM log_mig_error)
  </code></pre>
  
  <p>and this is the output:</p>
  
  <pre><code>MAX(UID_PROC)
  00000000000000000008
  00000000000000000009
  </code></pre>
  
  <p>but I want JUST the last row, I tried</p>
  
  <pre><code>SELECT      (SELECT MAX(uid_proc) FROM LOG_MIG) UNION ALL (SELECT MAX(uid_proc) FROM log_mig_error) AS campo 
  FROM        log_mig 
  INNER JOIN  log_mig_error
  WHERE       (log_mig.uid_proc = log_mig_error.uid_proc);
  </code></pre>
  
  <p>with no success, I may create a view and from them get the maximum, but I don't have permissions to create anything, I must do this at runtime with one step, any help I'll appreciate</p>