title: Combine results of multiple queries in Oracle Sql
body: <p>Database - Oracle Database 10g Release 10.2.0.4.0 ,
  working with Oracle SQL Developer</p>
  
  <p><strong>EDIT</strong>
  Sorry: Query-1 Should be : </p>
  
  <p><code>SELECT TABLE_NAME FROM USER_TABLES;</code></p>
  
  <p>earlier it was <code>SELECT OWNER, TABLE_NAME FROM ALL_TABLES;</code> </p>
  
  <p>Output-1: ALL TABLES that I own</p>
  
  <p><strong>Query-2:</strong>
  <code>SELECT COUNT(*) FROM MYTABLE_1;</code></p>
  
  <p>Output-2: Total number of rows in specific table <strong>MYTABLE_1</strong></p>
  
  <p><strong>Query-3:</strong> <code>SELECT MAX(ORA_ROWSCN) FROM MYTABLE_1;</code></p>
  
  <p>Output of Query-3 is a number (493672033308) which is further used in Query-4</p>
  
  <p><strong>Query-4:</strong> <code>SELECT SCN_TO_TIMESTAMP(493672033308) FROM DUAL;</code></p>
  
  <p>Output-4 is last updated time of specific table <strong>MYTABLE_1</strong></p>
  
  <p>How to combine all of this to get a list of <strong>all user tables</strong> with a total of 3 columns having column headers <strong>TABLE_NAME, TOTAL_ROWS, LAST_UPDATE_TIME</strong> </p>
  
  <p><strong>EDIT-2: Final Query:</strong></p>
  
  <p><code>SELECT t.TABLE_NAME
          , m.TIMESTAMP
          , t.NUM_ROWS
          , ((NVL(t.NUM_ROWS,0) + m.INSERTS) - m.DELETES) AS TOT_ROWS
  FROM USER_TABLES t
       LEFT OUTER JOIN USER_TAB_MODIFICATIONS m
           ON t.TABLE_NAME = m.TABLE_NAME
  ORDER BY t.TABLE_NAME;</code></p>
  
  <p>Thanks APC, StevieG, bob dylan :)</p>