【问题标题】:how to select the rest of the table in mysql?如何在mysql中选择表的其余部分?
【发布时间】:2020-10-12 21:31:01
【问题描述】:

假设您有 2 张桌子。 书名) 和 主题(IDSUBJECT,标题) 其中主题中的标题引用书中的标题。 用什么查询可以找到某个主题不喜欢的所有书籍?

【问题讨论】:

标签: mysql sql join select subquery


【解决方案1】:

使用not exists:

select b.*
from books b
where not exists (select 1 from subject s where s.title = b.title)

【讨论】:

    猜你喜欢
    • 2018-01-05
    • 2020-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-02
    • 2012-05-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多