Re: Using SQL to return column average

2008-02-27 Thread Renee Spadaro
You have to include LessonTitle in the group by. Try that. Renee > Hello All, > > I've been trying to write the following query: > > > SELECT l.LessonTitle, l.lessonPK, > AVG(r.Rating) AS RatingAvg > FROM Rating r RIGHT OUTER JOIN L

RE: Using SQL to return column average

2008-02-27 Thread Jim Schell
John, Try putting your lessonTitle in the Group BY section Jim -Original Message- From: John Ahlen [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 12:25 PM To: CF-Newbie Subject: Using SQL to return column average Hello All, I've been trying to write the following

Re: Using SQL to return column average

2008-02-27 Thread Greg Morphis
You'll have to group by lessontitle too.. any time you use an aggregate function you have to group by whatever else is in your select statement. On Wed, Feb 27, 2008 at 3:24 PM, John Ahlen <[EMAIL PROTECTED]> wrote: > Hello All, > > I've been trying to write the following query: > > >

Using SQL to return column average

2008-02-27 Thread John Ahlen
Hello All, I've been trying to write the following query: SELECT l.LessonTitle, l.lessonPK, AVG(r.Rating) AS RatingAvg FROM Rating r RIGHT OUTER JOIN LessonPlan l ON l.LessonPk = r.LessonPk WHERE l.Grade = 1 AND l.