gpt4 book ai didi

mysql - 通过 mySQL 列出所有重复的帖子

转载 作者:行者123 更新时间:2023-11-29 02:06:04 25 4
gpt4 key购买 nike

如何列出 wp_posts 中具有相同 post_title 的所有帖子?

最佳答案

考虑到 BrokenCrust 的评论

Assuming that wp_posts is from WordPress, it may also contain post revisions and pages or menus (and now custom types) that have the same post_title but that are not duplicate posts.

SELECT p1.* FROM wp_post p1 
INNER JOIN wp_post p2 ON (p1.id <> p2.id
AND p1.post_title = p2.post_title
AND p1.revisions = p2.revisions
AND p1.page = p2.page)

如果您不想在列表中看到重复

SELECT DISTINCT p1.post_title FROM wp_post p1 
INNER JOIN wp_post p2 ON (p1.id <> p2.id AND p1.post_title = p2.post_title)

关于mysql - 通过 mySQL 列出所有重复的帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5811337/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com