MySQL: Get rows that are not logged in a joined table


I got this 3 tables as shown aboved.

My goal is to get all bits that user 1 (jm) did not put a reaction to.

Currently I have this MySQL code:

select * from bit b LEFT JOIN bit_reaction br ON ( AND br.userId != 1)

The problem here is that = 2 is being returned since br.userId is not equal to 1. The correct behavior is that it would only return bits with id 2 and 3.

Thanks for the tip!

Source: mysql

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.