Hola!
Tengo problemillas con este subquery, me sale error de sintaxis, pero no puedo ubicar el error. Si lo ejecuto sin el subquery funciona perfectamente
La base de datos es MySQL
SELECT title,penname,s.psid,s.uid,catid,s.rid,
r.ratingwarning,r.warningtext,SUM( numreviews ) AS reviews,
sum(counter) as lecturas, count(s.sid) as capitulos,
(SELECT avg(re.rating)
FROM fanfiction_reviews re
WHERE psid=s.psid AND sid=s.sid) as Estrellas
FROM fanfiction_stories s
INNER JOIN fanfiction_authors a ON a.uid=s.uid
INNER JOIN fanfiction_ratings r ON r.rating=s.rid
GROUP BY s.psid
ORDER BY lecturas desc, reviews DESC LIMIT 20
Gracias