Ver originalSELECT book_id, SUM(v.value) / COUNT(*) as nota FROM vote v GROUP BY v.book_id;
Ver originalSELECT b.id,b.title FROM book_autor ba INNER JOIN book b ON ba.book_id=b.id WHERE ba.author_id = {$author->id}
Ver originalSelect b2.title, b1.nota FROM (SELECT book_id, SUM(v.value) / COUNT(*) as nota FROM vote v GROUP BY v.book_id) as b1 INNER JOIN (SELECT b.id,b.title FROM book_autor ba INNER JOIN book b ON ba.book_id=b.id WHERE ba.author_id = {$author->id}) as b2ON b2.id=b1.book_idORDER BY b1.nota DESC