Question: ```
SELECT Author, count(Heading) AS "No. of books" FROM BOOKS GROUP BY Author;

```

Currently displays how many books each one of the authors has written. 

How can I make the code return only the Authors who have written exactly 2 books?

Answer: 
you can use having for filter the result for aggregated function

```
SELECT Author, count(Heading) AS "No. of books" 
FROM BOOKS 
GROUP BY Author
HAVING count(Heading)  = 2 ;

```
try this!!!

```
SELECT Author, count(Heading) AS "No. of books"  
FROM BOOKS  
HAVING count(Heading)  = 2  
GROUP BY Author;

```