I want to make a query that select all rows from a table except where rows in another table with same id as logged in user and has same value in another column.
Table1
id | value
=================
1 | 10
2 | 20
3 | 30
4 | 40
5 | 50
6 | 60
-
Table2
id | user_ids | another_column
=========================================
1 | 2 | 30
2 | 4 | 50
3 | 4 | 60
So if Table2.user_ids = (loggedin userid) and at the same time Table1.value = Table2.another_column - those rows should not be ouputted in the results.
If we say that we have a user with id:4, the user should not see row5 or row6 from Table1 because values matches
Should I go with some kind of subquery or join in the sql?