我有 4 张桌子:
bag_of_words(
ch_id,
frequency,
number,w_id
)
clinical_history(
ch_complete,
ch_id,p_id
)
patients(
p_id,
p_name
)
words(
w_id,
w_word
)
我有一个选定单词的列表。我需要从表中选择w_word
、p_name
、number
、freqency
和ch_id
。
我有这个查询,但它很慢,我需要它更快
SELECT
w_word,
p_name,
number,
frequency,
bag_of_words.ch_id
FROM
bag_of_words
LEFT JOIN
words
ON
words.w_id=bag_of_words.w_id
LEFT JOIN
clinical_history
ON
bag_of_words.ch_id=clinical_history.ch_id
LEFT JOIN
patients
ON
patients.p_id=clinical_history.p_id
WHERE
words.w_word IN (',,,,,')