我有9个选择句子。我想获得9个选择结果的交集。 但我将交叉应用于我的代码,但它没有用。
以下是我的代码。
(SELECT code_co.code, code_co.disease_co, code_en.disease_en
FROM code_co
LEFT JOIN code_en ON code_en.code = code_co.code
LEFT JOIN note ON note.code = code_co.code
LEFT JOIN inclusion ON inclusion.code = code_co.code
LEFT JOIN exclusion ON exclusion.code = code_co.code
LEFT JOIN ds ON code_co.code = ds.code
LEFT JOIN tx ON code_co.code = tx.code
LEFT JOIN sx ON code_co.code = sx.code
CROSS JOIN (
SELECT CONCAT( '%', ds_word.ds_en, '%' ) AS pattern
FROM ds_word
WHERE ds_co LIKE '%".$search[0]."%'
LIMIT 0 , 1
)const
WHERE note LIKE const.pattern
OR ds_content LIKE const.pattern
OR disease_en LIKE const.pattern
OR sx_content LIKE const.pattern
OR tx_content LIKE const.pattern
OR exclusion LIKE const.pattern
OR inclusion LIKE const.pattern
)
intersect
(SELECT code_co.code, code_co.disease_co, code_en.disease_en
FROM code_co
LEFT JOIN code_en ON code_en.code = code_co.code
LEFT JOIN note ON note.code = code_co.code
LEFT JOIN inclusion ON inclusion.code = code_co.code
LEFT JOIN exclusion ON exclusion.code = code_co.code
LEFT JOIN ds ON code_co.code = ds.code
LEFT JOIN tx ON code_co.code = tx.code
LEFT JOIN sx ON code_co.code = sx.code
CROSS JOIN (
SELECT CONCAT( '%', ds_word.ds_en, '%' ) AS pattern
FROM ds_word
WHERE ds_co LIKE '%".$search[1]."%'
....
OR inclusion LIKE const.pattern
)
intersect
(SELECT code_co.code, code_co.disease_co, code_en.disease_en
FROM code_co
LEFT JOIN code_en ON code_en.code = code_co.code
... /* for search[2] */
OR inclusion LIKE const.pattern
)
但是交叉不起作用。 请帮我交叉使用。
答案 0 :(得分:0)