title: Get number of records deleted sql
body: <p>I want to get the row count of how many records have been deleted. The below query returns the number of records that will be affected, but </p>
  
  <pre><code>SELECT COUNT(*) FROM suppliers
  WHERE EXISTS
    ( SELECT customers.customer_name
      FROM customers
      WHERE customers.customer_id = suppliers.supplier_id
      AND customer_id &gt; 25 );
  </code></pre>
  
  <p>I need something like this, after the rows have been deleted, I can show the number of records that have been deleted on the front end. </p>
  
  <pre><code>SELECT COUNT(*) FROM suppliers(
  DELETE from supplier(
      WHERE EXISTS
        ( SELECT customers.customer_name
          FROM customers
          WHERE customers.customer_id = suppliers.supplier_id
          AND customer_id &gt; 25 ));
  </code></pre>
  
  <p>I don't want to run the query twice, one to get the number of records that will be deleted, if its greater than 0, then I run the second query to delete the records.</p>