I am trying to understand how to select a user from users table that is not associated with current user in user_follows table: neither in users_id not in shown_users_id.
Basically a new user that not related to my current user.
Tried something like this:
SELECT user.id FROM users AS user LEFT JOIN user_follows AS follow ON user.id = follow.users_id LEFT JOIN user_follows AS follow2 ON user.id = follow2.shown_users_id WHERE user.id != 2 # (user that I don't wan't to select) LIMIT 1;
But it would still return me the row with user 3 in it.
So if in my users table I have user 2,3,4, and with the following data in user_follows table:
I only want to get user 4, since it is not associated with user 2 at this moment.