
February 24th, 2003, 12:19 AM
|
|
Contributing User
|
|
Join Date: Feb 2003
Posts: 45
Time spent in forums: 5 h 28 m 27 sec
Reputation Power: 11
|
|
|
LEFT JOIN with AVG()
This is my query:
select b.bookID,b.title,b.author,b.connection,AVG(r.score) from books b LEFT JOIN book_ratings r on b.bookID=r.bookID group by r.bookID,b.bookID,b.title,b.author,b.connection order by UPPER(title);
I get the error:
Attribute unnamed_join.title must be GROUPed or used in an aggregate function
It works fine if I use a silent inner join, or if I replace the AVG with another field from that table and remove the GROUP BY clause.
Help? I don't understand the error given that b.title is part of the GROUP.
|