Harold Wood wrote:
>my approah would be a table for applicants, then the table for answers
would have the applicantid and the questionid as well as the answer.
>
>CREATE TABLE tblApplicants (applicantid int, applicantname
varchar(100)); 
>now just do a select joining the tables
>
>select ap.applicantname, qu.question, an.answer from tblanswers an
inner join tblApplicants ap on ap.applicantid = an.applicantid inner
join tblquestions qu on qu.questionid = an.questionid
>-- optional where clause to select just 1 applicant where
ap.applicantid = 1
>-- optional order by clause to make it neat order by applicantname asc,
qu.questionid asc
>
>

I am planning on having an applicant table (I guess I just left that to
be assumed in the first post - sorry) but that isn't going to help my
need at all.

Your query gives me these results:

andrea|whats up|stuff for answer one
andrea|how are you|stuff for answer two
andrea|whats your name|stuff for answer three
todd|whats up|random text one
todd|how are you|random text two
todd|whats your name|random text three

When what I want is this:

100|stuff for answer one|stuff for answer two|stuff for answer three
200|random text one|random text two|random text three


I want one row with all answers for an applicant, and I want it to work
for an arbitrary number of rows in tblQuestions or be able to update
itself on an insert or delete. Any ideas?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to