Fabian Köhler wrote:
> i have table with answers to questions. Every answer is a column in the table. i.e.
> another option to save it would be sth like this:
> The last one is not really useable when working with large amounts of data, when you
> want to select i.e. 200 questions with answers it's 200*nof answers queries to get them.
> The problem with the first solution is, that MyISAM storage engine is limited to 2599
> columns i think. So what's happening if i have more answers than columns available?
> Does anybody have an idea? VIEWs or GROUP_CONCAT doesn't seem to be an option, they
> are all to slow. What's the "right" way to store and select such information?
> Thank you very much.
> Fabian Köhler http://www.fabiankoehler.de
Definately curtain number two. It allows you to save space in case of
not answered questions, and also to extend your database to be able to
handle different query series (i.e. with a different number of questions).
The number of database queries depends you need to make to extract the
data, depends on the number of question series (or alternitavely the
number of users), not the number of answers. You can select all answers
in a single query.
You'll need a left join in that query.
Camille Huysmanslaan 114, bus 2
+32 (0)3 707 08 08
+32 (0)473 47 62 88
bankrek.nr. ING 363-0106543-77