-4

我有以下类别(多对多关系):

+ post

post_tag

+ tag

post_category

+ category

我如何创建 SQL 查询来检查哪些标签在没有类别的帖子中?

谢谢!!!

4

1 回答 1

3
select  distinct pt.tagname
from    post_tag pt
where   not exists
        (
        select  *
        from    post_category pc
        where   pc.post_id = pt.post_id
        )
于 2012-12-21T14:13:42.147 回答