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

后端 未结 3 693
旧巷少年郎
旧巷少年郎 2021-01-21 12:15

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

3条回答
  •  春和景丽
    2021-01-21 12:52

    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
    

提交回复
热议问题