title: Problem with SQL code: Subquery returns more than 1 row:
body: <p>I have two tables which are &quot;authors&quot; and &quot;listened&quot; and, what I am trying to do is count how many books I have listened to by a particular author and then get the last book I listened to by that author. The code I have is:</p>
  <pre><code>SELECT COUNT(`listened`.`id`) AS `count`, `authors`.`name` AS `author`, (SELECT `title` FROM `listened` WHERE `author` = `authors`.`id` ORDER BY `read` DESC) AS `last` FROM `authors` INNER JOIN `listened` ON `authors`.`id` = `listened`.`author` GROUP BY `listened`.`author`;
  </code></pre>
  <p>This code results in the following error:</p>
  <pre><code> #1242 - Subquery returns more than 1 row
   
  </code></pre>
  <p>My problem is that I can't figure out how to rewrite it and the previous answers here do not seem to help.</p>