title: Slick 2.0: Delete multiple rows
body: <p>What I wanted to do is delete the N oldest ids from my table using this function: </p>
  
  <pre><code>def deleteOldRows(size: Int)(implicit s: Session): Int =
    MyTable.sortBy(_.id.asc).take(size).delete
  </code></pre>
  
  <p>This operation throws a <code>SlickException</code> because </p>
  
  <blockquote>
    <p>A query for a DELETE statement must resolve to a comprehension with a single table -- Unsupported shape: Comprehension(fetch = None, offset = None)</p>
  </blockquote>
  
  <p>As stated also on the documentation: </p>
  
  <blockquote>
    <p>A query for deleting must only select from a single table. Any projection is ignored (it always deletes full rows).</p>
  </blockquote>
  
  <p>What is triggering the multiple table? Is it because the <code>sortBy</code> clause creates a temporary table to store the results? For the moment I rewrote my query to this: </p>
  
  <pre><code>MyTable.sortBy(_.id.asc).take(size).list().map(result =&gt; MyTable.filter(_.id === result.id).delete)
  </code></pre>
  
  <p>Which is basically take the ids and for each one filter and delete, is there a more readable and direct way to delete multiple rows at once?</p>