0
它在我不想包含分數的情況下起作用。但是,這對於搜索結果的排序當然很重要。這不起作用:解讀我對mysql語句的匹配
SELECT * from
(SELECT distinct ts.users_user_id from subjects s
JOIN teachers_subjects ts ON s.subject_ID = ts.subject_id, MATCH (s.subject_en_name) AGAINST ('math') AS score
WHERE MATCH (s.subject_en_name) AGAINST ("math")) qualified
JOIN users u ON qualified.users_user_id = u.user_id
JOIN users_teachers ut ON qualified.users_user_id = ut.user_id
JOIN teachers_subjects ts2 ON qualified.users_user_id = ts2.users_user_id
JOIN subjects s2 ON ts2.subject_id = s2.subject_id
這工作,但不包括各行的得分:
SELECT * from
(SELECT distinct ts.users_user_id from subjects s
JOIN teachers_subjects ts ON s.subject_ID = ts.subject_id
WHERE MATCH (s.subject_en_name) AGAINST ("math")) qualified
JOIN users u ON qualified.users_user_id = u.user_id
JOIN users_teachers ut ON qualified.users_user_id = ut.user_id
JOIN teachers_subjects ts2 ON qualified.users_user_id = ts2.users_user_id
JOIN subjects s2 ON ts2.subject_id = s2.subject_id
它有幫助嗎? – peterm