I have a problem in MySQL when trying to select specific entry from table which is not in another table. I know this sentence sounds nuts but here is an example what I am trying
Try this:
SELECT user_id
FROM users
WHERE user_id NOT IN (
SELECT user_id
FROM views
WHERE article_id = 10
)
SELECT user_id FROM users u
LEFT JOIN views v ON v.user_id=u.user_id AND v.article_id = 10
WHERE v.user_id IS NULL
doing NOT IN queries are not typically great for performance... instead, using LEFT JOIN and looking for NULL would be better.
select
u.User_ID
from
Users U
LEFT JOIN Views V
on U.User_ID = V.User_ID
AND v.Article_ID = 10
where
V.User_ID IS NULL