我有了這些表電影數據庫:new_movies,收視率,critic_ratings,顏色有許多表來選擇MySQL的適當的方式參與
我試圖執行此SELECT語句將結合在同這4個表使用 'MID'(電影ID)電影:
SELECT DISTINCT
new_movies.*,
movies_db.*,
ratings.rating,
ratings.count,color,
critic_ratings.rating AS critic_ratings
FROM
new_movies
INNER JOIN
movies_db
ON
new_movies.mid = movies_db.mid
LEFT JOIN
ratings
ON
new_movies.mid = ratings.mid
LEFT JOIN
colors
ON
new_movies.mid = colors.mid
LEFT JOIN
critic_ratings
ON
new_movies.mid = critic_ratings.mid
ORDER BY
title ASC
但我得到這個錯誤:
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
如何正確做查詢?
你試過'SET SQL_BIG_SELECTS = 1'還是'SET SQL_MAX_JOIN_SIZE =#'? – Flimzy