If I understand you correctly, then you can do this with 2 queries, for example, I made this right now for you:
- Table 1
- Table 2
- First query:
- Second query:
- The condition of the second query:
Which is:
query.join(',', 'user').split(',')
The results are:
You can see that the second query doesn’t have user1/user2/user3 because they are on the first query.