title: How to subtract values using SQL
body: <p>Could you tell me how can I subtract values?</p>
  
  <p>SQL> </p>
  
  <pre><code>select SUM(bytes/1024/1024) from dba_data_files where TABLESPACE_NAME='UNDOTBS1'
  </code></pre>
  
  <p>2  ;</p>
  
  <pre><code>SUM(BYTES/1024/1024)
  --------------------
              7000
  </code></pre>
  
  <p>SQL>  </p>
  
  <pre><code>select SUM(BYTES/1024/1024) from DBA_UNDO_EXTENTS where STATUS LIKE 'ACTIVE';
  
  SUM(BYTES/1024/1024)
  --------------------
                 8
  </code></pre>
  
  <p>I need to get a value 7000 - 8</p>
  
  <p>When I do</p>
  
  <pre><code>select SUM(bytes/1024/1024) from dba_data_files where TABLESPACE_NAME='UNDOTBS1'
  minus
  select SUM(BYTES/1024/1024) from DBA_UNDO_EXTENTS where STATUS='ACTIVE';
  </code></pre>
  
  <p>I get result only from the first select.</p>