Dave
2006-12-12 11:44:28 UTC
Hi
I'm having trouble with some sql and don't know if my table design is
incorrect.
I have a table of delegate names.
I have a table of possible questions the delegate can answer.
I then have a table which contains many rows for each delegate, each row
showing which question the delegate has answered.
So for example, delegate id 10 has answered question 1 and question 7, so
there would be two rows
DelegateID QuestionID
10 1
10 7
etc.
How do i write a query that selects delegates that have answered question 1
AND question 7?
I tried "select delegateID where questionID=1 AND questionID=7, but of
course no records were returned since no records satisfied both question
IDs.
Any help would be greatly appreciated.
I'm having trouble with some sql and don't know if my table design is
incorrect.
I have a table of delegate names.
I have a table of possible questions the delegate can answer.
I then have a table which contains many rows for each delegate, each row
showing which question the delegate has answered.
So for example, delegate id 10 has answered question 1 and question 7, so
there would be two rows
DelegateID QuestionID
10 1
10 7
etc.
How do i write a query that selects delegates that have answered question 1
AND question 7?
I tried "select delegateID where questionID=1 AND questionID=7, but of
course no records were returned since no records satisfied both question
IDs.
Any help would be greatly appreciated.