title: Count number of Rows with the same value in a Column
body: <p>I have these two entity with their attributes:</p>
  
  <blockquote>
    <blockquote>
      <p>book - book_id, book_name, author_id, editor_id, subject_id, isbn</p>
      
      <p>author - author_id, fn, ln</p>
    </blockquote>
  </blockquote>
  
  <p>I have to query the author with the most number of rows
  here's the attributes and entity:</p>
  
  <pre>
  | book_id | book_name   | author_id |  editor_id |  isbn     |
  --------------------------------------------------------------
  |       1 | Book1 Title |  Author1  |  Editor1   | 8000-9000 |
  |       2 | Book2 Title |  Author2  |  Editor1   | 8000-9001 |
  |       1 | Book1 Title |  Author1  |  Editor1   | 8000-9002 |
  |       3 | Book2 Title |  Author2  |  Editor1   | 8000-9003 |
  </pre>
  
  <pre>
  | author_id |  fn    |    ln    |
  ---------------------------------
  |       1   | name1  |  lname1  |
  |       2   | name2  |  lname2  |
  |       3   | name3  |  lname3  | 
  </pre>
  
  <p>and here is my code:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT author.author_id, author.fn, author.ln, COUNT(DISTINCT book.editor_id) as num
  FROM `editor`, `book`
  GROUP BY `editor_id`
  LIMIT 0,1
  </code></pre>
  
  <p>but off-course i don't get what I want.
  The output must be:</p>
  
  <pre>
  | author_id |  fn    |    ln    |
  ---------------------------------
  |       1   | name1  |  lname1  |
  </pre> 
  
  <p>since the "author_id = 1" has 2 entries on books.</p>