这是我的 MySQL 选择语句,我正在尝试做一个交集:
SELECT id
FROM
(SELECT id
FROM members WHERE id!=15 AND `last name` = `last name` AND (`first name` = "James") AND `email address` = `email address` AND `mobile number` = `mobile number` AND type_id = type_id AND active = active
) AS A
INNER JOIN
SELECT id
FROM
(SELECT DISTINCT m.members_id as id
FROM map m
WHERE m.members_id!=15 AND (((SELECT count(*) FROM tasks) = 0) OR (((SELECT count(*) FROM checklist WHERE map_id=m.id) / (SELECT count(*) FROM tasks)) * 100 >= 0 AND ((SELECT count(*) FROM checklist WHERE map_id=m.id) / (SELECT count(*) FROM tasks)) * 100 <= 100)) AND m.`topic` = m.`topic` AND m.`location` = m.`location` AND m.`country` = m.`country` AND m.`city` = m.`city` AND m.`organization` = m.`organization`
) AS B
USING (id)
这是我看到的示例相交代码
SELECT DISTINCT value FROM table_a
INNER JOIN table_b
USING (value);
但是,我在“内部连接”附近遇到语法错误。有谁知道这里有什么问题?