clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 984296 fiddles created (11682 in the last week).

CREATE TABLE BOOKS (BOOK_ID INT, USER_ID INT); INSERT INTO BOOKS VALUES (1, 1), (1, 2), (2, 17), (2, 16), (3, 17), (3, 16), (4, 3), (4, 16); CREATE TABLE USERS (USER_ID INT, Name VARCHAR(10)); INSERT INTO USERS VALUES (1, 'Jeff'), (2, 'Bill'), (3, 'Fred');
11 rows affected
 hidden batch(es)


SELECT BOOK_ID, COUNT(USERS.USER_ID) AS USERS FROM BOOKS LEFT JOIN USERS ON USERS.USER_ID = BOOKS.USER_ID GROUP BY BOOK_ID HAVING COUNT(USERS.USER_ID) = 0;
BOOK_ID USERS
2 0
3 0
Warning: Null value is eliminated by an aggregate or other SET operation.
 hidden batch(es)