Reputation: 11
Hellow guys i have a question it is posible to show and group same answers from a query?
here is the sample of the table i am working on:
Table
ID-----Q1-----Q2-----Q3-----Q4-----Q5-----Q6-----Q7-----Q8-----Q9-----Q10
1 Y N Y N M N M M M Y
What i want to do is this:
Y = Q1, Q3, Q10
N = Q2, Q4
M = Q6, Q7, Q8, Q9
it is possible to display the name of the column in my example?
Upvotes: 0
Views: 24
Reputation: 180858
You're doing this wrong. What you need is a Questions table, not a table with Questions columns.
Questions Table
------------------
QuestionID PK
Question Text
Answers Table
-----------------
AnswerID PK
QuestionID FK
UserID FK
Answer Text
Upvotes: 1