left outer join issue in mysql -
i seek rows in parts_keywords not included in parts_questions. unfortunately, getting rows of both tables.
select *from parts_keywords left outer bring together parts_questions on parts_keywords.id = parts_questions.question_id parts_questions.question_id null , parts_keywords.term '%where%' || parts_keywords.term '%how%' || parts_keywords.term '%who%' || parts_keywords.term '%what%' order parts_keywords.id desc limit 15
i have tried using or instead of ||. have tried using match instead of no avail.
when utilize 1 element, such 'who' right results. however, of import me result elements together.
please help
try using paranthesis
select * parts_keywords pk left outer bring together parts_questions pq on pk.id = pq.question_id pq.question_id null , ( pk.term '%where%' or pk.term '%how%' or pk.term '%who%' or pk.term '%what%' ) order parts_keywords.id desc limit 15
mysql join like outer-join
No comments:
Post a Comment