title: sql with clause in rails
body: <p>I have this SQL query:</p>
  
  <pre><code>WITH excluded_authors as 
      (SELECT author_id from authors_books)
  SELECT authors.* from authors 
       WHERE authors.id not in 
       (SELECT author_id FROM excluded_authors)
  </code></pre>
  
  <p>The objective here is to get all the authors that have no books yet. </p>
  
  <p>How do I formulate that query in rails (other than copying it into <code>find_by_sql</code> ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried this:</p>
  
  <pre><code>Author.where.not("\"authors\".\"id\" in \"authors_bilios\".\"authors_id\"")
  </code></pre>