title: Oracle capture count of minus operation
body: <p>I have 2 tables (TABLE_A &amp; TABLE_B) where I'm using the MINUS command to see if there are differences in the tables.</p>
  <p>In my example below you can see that TABLE_A has an additional row.</p>
  <p>Is there a way to capture the numeric difference between the two tables, in this case 1 row.</p>
  <p>If there is a difference &gt;0 then display the value. Although my example is small it could contain many rows. Therefore I would only like to do the MINUS command once if possible. I'm also also amenable to alternative solutions and not tied to the MINUS command or if this can be done with SQL only that will work too.</p>
  <p>Thanks in advance for your expertise and all who answer.</p>
  <pre><code>
  CREATE TABLE TABLE_A(
   seq_num NUMBER  GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
  nm VARCHAR(30)
  );
  /
  
  CREATE TABLE TABLE_B(
  seq_num NUMBER  GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
   nm VARCHAR(30)
  );
  /
  
  BEGIN
   FOR I IN 1..4 LOOP
    INSERT INTO TABLE_A (nm) VALUES('Name '||I);
  end loop;
  
  FOR I IN 1..3 LOOP
    INSERT INTO TABLE_B (nm) VALUES('Name '||I);
  end loop;
  
   END;
   
  -- MINUS operation
  
  SELECT nm FROM TABLE_A
  MINUS
  SELECT nm FROM  TABLE_B;
  
  Output:
  NM
  Name 4
  
  Pseudo code
  
  Do minus command
  
  If difference &gt;0 then display rows
  
  </code></pre>