|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm really stuck with an SQL statement that i wish to build. What i have are a number of tables : Table : Questions --------------- QuestionID | QuestionName | QuestionText --------------------------------------------------------------------------------------------------- 1 | Question 1 | This is my first question 2 | Question 2 | This is my second question Table : Options ----------------------- OptionID | QuestionID | OptionText --------------------------------------------------------------------------------------------------- 33 | 1 | This option is for Question 1 34 | 1 | This is my second option Question 1 35 | 2 | This option is for Question 2 36 | 2 | This is my second option Question 2 Table: Answers ---------------------- AnswerID | QuestionID | OptionID | SessionID (Computer Session ID) ------------------------------------------------------------------------------------------------------- 1 | 1 | 33 | 4352652652 2 | 2 | 35 | 4352652652 3 | 1 | 36 | 3242345454 4 | 2 | 36 | 3242345454 Basically, i want to create an output in asp (i know asp fairly well) but i can't figure out how to join these I need to select from the Table Answers, where sessionID = my inputted session ID The display all answers of that session ID ( i know how to do this) But rather than display the answers as : 33, 35, 36 - i want to reference the Option Text from the Options Table - basically displaying something like All Answers for Session ID: 4352652652 QuestionID | QuestionName | Answer/Option ----------------------------------------------------------------------------------------------------------- 1 | Question 1 | This option is for Question 1 2 | Question 2 | This is my second option Question 2 Hope i haven't confuses too many people. Can anyone advise how i can go about this ? Many thanks, Billybong |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Multiple Table Select |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|