I need to Create a VIEW
This is what I have so far:
SELECT Book.BookTitle
FROM Book, Borrower, Client
WHERE Book.BookId = Borrower.BookId AND Borrower.ClientId = Client.ClientId AND COUNT(Book.BookId) >
(SELECT COUNT(Client.ClientId) FROM Client)*0.2
GROUP BY Book.BookTitle
ORDER BY COUNT(Book.BookTitle) DESC;
I keep getting this error: Msg 147, Level 15, State 1, Line 547 An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.
What am I doing wrong?
FROMclause but noJOIN. Why not? - Gordon Linoff