これは、交差を実行しようとしている MySQL の select ステートメントです。
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);
From: MySQL の Intersect の代替
ただし、「内部結合」の近くで構文エラーが発生します。ここで何が悪いのか誰か知っていますか?