The following code runs exactly the way I want it to. Now I need to achieve the same task but only showing results with a COUNT greater than 1. The COUNT is meant to count the amount of rows in the allocation table of each distinct book id (bid).
Prompt Task 1E7;
SELECT B.bid,title,COUNT(*)
FROM ALLOCATION A
INNER JOIN BOOK B
ON A.bid = B.bid
GROUP BY B.bid,title
ORDER BY COUNT(*),bid;
I tried simply putting a WHERE COUNT(*) > 1 in a few different locations. This just returns the error "SQL command not properly ended" for the WHERE line. I also tried the following.
Prompt Task 1E7;
SELECT B.bid,title,COUNT(*)
FROM ALLOCATION A
INNER JOIN BOOK B
ON A.bid = B.bid
GROUP BY B.bid,title
WHERE (SELECT COUNT(*)
FROM ALLOCATION A
INNER JOIN BOOK B
ON A.bid = B.bid
GROUP BY B.bid,title) > 1
ORDER BY COUNT(*),bid;
and any other number of little tweaks.