Andrea Connell <[EMAIL PROTECTED]> wrote:
> Here is the view I have come up with so far, which would require
> editing whenever an insert or delete is done on tblQuestions.
>
> CREATE VIEW allanswers as
> SELECT applicantid,
>              (select answer from tblanswers Z where questionid = 1 and
> Z.applicantid = A.applicantid) As Answer1,
>              (select answer from tblanswers Z where questionid = 2 and
> Z.applicantid = A.applicantid) As Answer2,
>              (select answer from tblanswers Z where questionid = 3 and
> Z.applicantid = A.applicantid) As Answer3
> FROM tblanswers A
> group by applicantid;
>
> sqlite> select * from allanswers;
> 100|stuff for answer one|stuff for answer two|stuff for answer three
> 200|random text one|random text two|random text three

SQL is designed to handle recordsets with fixed number of columns and 
variable number of rows. It is not set up to handle variable number of 
columns.

What do you feel you need such a beast for? Imagine you somehow have 
it - what do you plan to do with it?

Igor Tandetnik



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

Reply via email to