title: count and a sub select
body: <p>i have a select that brings up title, bookcopiesid, and name. </p>
  
  <pre><code>select 
      books.title, borrow.bookcopiesid, users.name, usersid,library_locations.name, checkout_date, return_date, due_date 
  FROM 
      books,  borrow,users, library_locations, userlib 
  WHERE 
      library_locations.id = userlib.libid 
  AND 
      userlib.userid = users.id 
  AND 
      borrow.bookcopiesid = books.bookid 
  AND 
      borrow.usersid = users.id and return_date is not null ;
  </code></pre>
  
  <p>how would i get something like </p>
  
  <pre><code>SELECT title, COUNT(*) as count 
  FROM (
      SELECT books.title, borrow.bookcopiesid, users.name, usersid,library_locations.name, checkout_date, return_date, due_date 
      FROM books,  borrow,users, library_locations, userlib 
      WHERE library_locations.id = userlib.libid and userlib.userid = users.id and borrow.bookcopiesid = books.bookid and borrow.usersid = users.id and return_date is not null) 
  GROUP BY title 
  ORDER BY count DESC); 
  </code></pre>
  
  <p>to work. </p>
  
  <p>i am trying to display the number of titles for each name</p>