Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two different tables with different values and i want to connect the answers to te questions.
How can i make a good link table?
My first table is:
answers:
SQL SELECT answer0,
answer1,
enz...
answer_id
FROM mto1.answers;
my seccond table is:
Questions:
SQL SELECT
question,
question_nr
FROM mto1.`questions`;
How can i connect question 1 to answer 1?
Greetz,
Dirk
So field answer1 should match up to the question associated with question_nr = 1? I think something like this:
QuestionsAndAnswers:
CROSSTABLE (question_nr, answer) // one row per answer, keyed by question_nr
LOAD
answer_id
,answer0
,answer1
etc.
;
SQL SELECT
answer_id
,answer0
,answer1
etc.
FROM mto1.answers
;
INNER JOIN (QuestionsAndAnswers)
LOAD
question
,question_nr
FROMmto1.'QUESTIONS'
;