title: How do you modify an SQL query to iteratate over every 100 results and then perform an outter query?
body: <p>The following query: </p>
  
  <pre><code>DELETE FROM attachmentdata
  WHERE attachmentid IN
    ( SELECT attachmentid
      FROM attachments
      WHERE pageid IN
        ( SELECT contentid FROM content_delete )
    );
  </code></pre>
  
  <p>works perfectly if the inner nested SELECT query returns a small list (maybe couple hundred).  </p>
  
  <p>But now I"m trying to run it on something that will return 10000 - 15000 rows and this is taking a long time.  I ran the query and after 45 minutes nothing happened. </p>
  
  <p>Is it possible to modify the query so that every 100 results that are returned by the inner SELECT it goes to the outer DELETE query and then moves on to the next 100 results?</p>