Hi All,
I've been trying to solve this for hours now with no end in sight, I'm
hoping that someone here might be able to help me.

I've got four tables set out as shown below:

tbl_student_details
id     student_id    name        study_mode
-------------------------------------------
1      12           Joe  Smith   1
2      123          Jane Smith   1


tbl_study_mode
id   txt_study_mode
--------------------------------
1   Full Time
2   Part Time
3   Online


tbl_student_history_answers
id    question_id   p_answer
----------------------------------------
1    19             Network Management
2    19             Web Site Production
3    19             Web Site Management
4    20             Network Management
5    20             Web Site Production
6    20             Web Site Management

tbl_student_history_info
id   student_id    question_id    answer_id
-------------------------------------------
1    12            19             1
2    12            20             6
3    123           19             5
4    123           20             6

Basically I need to pull out student_id, name and course selected for
all students who elected full time study - and their response to
question 19 and 20

I already have two separate queries and would like to join them, but I
just can't seem to figure it out.

The queries I have so far are:

SELECT tbl_student_history_info.student_id,
tbl_student_history_answers.panswers as Preference_1
FROM tbl_student_histpry_info, tbl_student_histpry_answers
WHERE tbl_student_history_info,question_id = 19 AND
tbl_student_history_info.answer = tbl_student_history_answers.id;

SELECT tbl_student_details.student_id, tbl_student_details.name,
tbl_study_mode.txt_study_mode
FROM tbl_student_details, tbl_study_mode
WHERE tbl_student_details.study_mode = tbl_study_mode.id;

Basically I'm after a query that returns student_id, name, the student
study mode and their answer to question 19.

Any help/clue stick whacks are most welcome ! :-)

--
Rgds,
Chris MacKenzie

Windows: "Where do you want to go today ?"
 Mac OS: "Where do you want to be tomorrow ?"
  Linux: "Are you coming or what ?"


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to