Skip to content
Advertisement

Column ‘Book.Title’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause

I’m creating a Library Management System and in the database I want to display book ISBN, Title and No. of copies of each book with their located library.

Here’s the code I tried :

It gives me the error Column ‘Book.Title’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

Some tips on solving this?

Advertisement

Answer

One simple rule: You can not use the actual column without any aggregation in the SELECT clause which is not a part of the GROUP BY.

So in your query, It should be:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement