Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
PiecesOfEight
Posting Yak Master
200 Posts |
Posted - 2001-05-22 : 00:44:15
|
I'm working on a problem that has had me stumped for a while. After a number of fruitless attempts, I'm asking the experts.There are 5 tables involved in this problem: Session-------SessionID (PK)Task----TaskID (PK)TaskTitleQuestion-------- QuestionID (PK)SessionTask-----------SessionID (PK)(FK)TaskID (PK)(FK)TaskResponseSessionQuestion---------------SessionID (PK)(FK)QuestionID (PK)(FK)QuestionResponseI need to produce output like so, with a row for each task response, and the question reponses duplicated in each row: Session ID | Task Title | Task Response | Q1 Response | Q2 Response | ... | Q13 Response---------------------------------------------------------------------------------------- 80 task1 response1 q1resp q2resp q13resp 80 task2 response2 q1resp q2resp q13resp 80 task3 response3 q1resp q2resp q13resp 81 task3 response3 q1resp q2resp q13resp |
|
|
|
|
|