Sample Header Ad - 728x90

Select IDS where all values can't be found in another table

2 votes
2 answers
184 views
Hey I'm pretty new to SQL and I've come up with a problem that I haven't been able to solve I'm trying to make a query to bring up ID's that have ALL null values and are located in another table. DB looks like: Table 1 BOOK ID| User ID 1 | 1 1 | 2 2 | 17 2 | 16 3 | 17 3 | 16 4 | 3 4 | 16 Table 2 USER ID | Name 1 | Jeff 2 | Bill 3 | Fred The desired outcome would be to bring up Book IDs 2 and 3 as both IDs only have users that cannot be found in Table 2.
Asked by Bino (23 rep)
Oct 15, 2019, 02:50 PM
Last activity: Feb 2, 2020, 06:14 PM