作者:阮三岁 | 来源:互联网 | 2023-10-16 22:27
本文由编程笔记#小编为大家整理,主要介绍了sql 查询删除InfiniteWP站点历史记录和已删除站点的统计信息。相关的知识,希望对你有一定的参考价值。
DELETE FROM iwp_history WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
DELETE FROM iwp_history_additional_data WHERE historyID NOT IN ( SELECT historyID FROM iwp_history );
DELETE FROM iwp_history_raw_details WHERE historyID NOT IN ( SELECT historyID FROM iwp_history );
DELETE FROM iwp_site_stats WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
DELETE FROM iwp_user_access WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
DELETE FROM iwp_groups_sites WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
UPDATE iwp_sites SET adminUsername = 'todo' WHERE adminUsername = 'pronamic';
SELECT
s.siteID,
s.URL,
s.name,
s.adminUsername
FROM
iwp_sites AS s
LEFT JOIN
iwp_groups_sites AS gs
ON gs.siteID = s.siteID
WHERE
gs.groupID = 3
;