title: How to subtract a query result from another query result in MYSQL
body: <p><strong>1st query</strong> </p>
  
  <pre><code>   (SELECT a.cat_id, 
            a.cat_name, 
            a.cat_description, 
            b.subcat_name, 
            b.subcat_description 
       FROM trade_categories a 
  LEFT JOIN trade_subcategories b ON a.cat_id = b.cat_id 
      WHERE a.cat_name LIKE '%catty%' 
         OR a.cat_description LIKE '%catty%') 
  UNION 
    (SELECT c.cat_id, 
            d.cat_name, 
            d.cat_description, 
            c.subcat_name, 
            c.subcat_description 
       FROM trade_subcategories c 
  LEFT JOIN trade_categories d ON c.cat_id = d.cat_id 
      WHERE c.subcat_name LIKE '%catty%' 
         OR c.subcat_description LIKE '%catty%') 
  </code></pre>
  
  <p><strong>2nd query :</strong></p>
  
  <pre><code>SELECT x.cat_id, 
         x.cat_name, 
         x.cat_description, 
         y.subcat_name, 
         y.subcat_description 
   FROM  trade_categories x 
    JOIN trade_subcategories y ON x.cat_id = y.cat_id 
   WHERE (   x.cat_name LIKE '%catty%' 
          OR x.cat_description LIKE '%catty%' ) 
     AND (   y.subcat_name NOT LIKE '%catty%' 
          OR y.subcat_description NOT LIKE '%catty%' )
  </code></pre>
  
  <p>I want to subtract the 2nd query result from 1st query result.</p>