I have 2 tables , Users and Friends Table, Users have uID, Friends have UID as well, I want to check the UIDs present in Users table but not present in Friends Table, I am using this query
SELECT b.userId
FROM users b
where b.userId NOT IN(
select userId
from user_friend
)
But it is returning me all the rows of Users Table.. Am I missing something? Example Data in MYSQL
Users Table
1
2
3
4
Friends Table
2
3
4
I actually need to get 1