MySQL Forums
Forum List  »  Optimizer & Parser

Re: Question regarding 5.0 LEFT JOIN
Posted by: Peter Brawley
Date: March 27, 2006 06:23PM

In MySQL 5 forget comma joins. Use explicit join syntax, eg

SELECT vq.vocab_question_id, vq.question_order, v.vocab_id, v.vocab_order, sp.part_id, sp.part_order
FROM person p
INNER JOIN part sp ON ??? -- not specified in your query
INNER JOIN vocab v ON sp.part_id = v.part_id
INNER JOIN vocab_question vq ON v.vocab_id = vq.vocab_id
LEFT JOIN answer_vocab sa
ON (sa.vocab_question_id = vq.vocab_question_id AND sa.person_id = p.person_id)
WHERE p.person_id='5'
AND sp.passage_id = '48'
AND sa.student_answer IS NULL
ORDER BY sp.part_order, v.vocab_order, vq.question_order

Options: ReplyQuote

Written By
March 27, 2006 04:59PM
Re: Question regarding 5.0 LEFT JOIN
March 27, 2006 06:23PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.