php - MySQL select specific entry from a table which is not in another table -


i have problem in mysql when trying select specific entry table not in table. know sentence sounds nuts here example trying do.

table users:

    user_id,username,password (plus other columns not important this) 

table articles:

    article_is,user_id,content (plus others) 

table views (used store data if user viewed specific article):

   view_id,article_id,user_id,date 

now, trying select users has not read specific article, example article id 10. have no entry in views table.

i hope makes more sense now. answers. v.

select user_id users u left join views v on v.user_id=u.user_id , v.article_id = 10 v.user_id null 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -