0
votes

I am getting error:

Column 'movie.title' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

So I used GROUP BY statement, but it does not help.

SQLFiddle: http://www.sqlfiddle.com/#!6/25cab/13

2

2 Answers

2
votes

All items in the SELECT-clause must be in the GROUP BY - clause as well.

An alternative way could be to COUNT the reserve.ID in a preceding query.

If you put only one item from the SELECT clause within GROUP BY it remains unclear, what should happen to the other ones: SUM, MAX, MIN, ??????

0
votes

The cause for your problem is "Count(reserved.id) AS Expr1". This does not make any sense without a GROUP BY-statement.