I have to print out only the publishers that published more than 2 books, but for my results, I always get
PUB_NAME |TOTAL
--------------------------------
Abatis Publishers |4
Core Dump Books |1 <------don't want to print
Schadenfreude Press |3
Tenterhooks Press |5
ERROR 42X01: Syntax error: Encountered "HAVING"
This is my code so far.
SELECT pub_name, COUNT(title_name) AS total
FROM publishers
INNER JOIN titles
ON titles.pub_id = publishers.pub_id
GROUP BY pub_name;
HAVING total > 2;