Page 1 of 1

select query issue

Posted: Sun Apr 20, 2008 9:47 am
by itsmani1
Hi

I have two tables

questions
answers

One question can have many answers

i want to select all the questions with all answers

i also want to select the questions which are not answered yet.

thank you

Re: select query issue

Posted: Sun Apr 20, 2008 11:01 am
by John Cartwright

Code: Select all

SELECT * FROM `questions`
LEFT JOIN `answers` ON `quesions`.`id` = `answers`.`question_id`
:)

Re: select query issue

Posted: Mon Apr 21, 2008 4:48 am
by aceconcepts
This link offers a rather straightforward approach to JOIN queries: http://w3schools.com/sql/sql_join.asp