Let me preface this by saying I am open to design criticism if i am making this harder than it needs to be.
I have 3 tables:
serials (id, number)
columns (id, name)
data (id, serial_id, column_id, value)
There are different amounts of rows in
data that correspond to each row of
serials.
What i am trying to retrieve is each
serials.number with all corresponding
data.value fields appended to the end of the result row. This is an example of what i am looking for if all corresponding
values were stored in a c-style array:
row 1: serials.number, data.value[0], data.value[1], data.value[2]
row 2: serials.number, data.value[0], data.value[1], NULL
row 3: serials.number, data.value[0], NULL, data.value[2]
row n: etc ...
The reasoning behind doing it this way was to allow the amount of columns to be different for varying implementations without having to ALTER TABLE. I also wanted the column name to support "full text" without having to write a parser for table field names. In addition to all of this, I need to gather all the information in 1 query as to facilitate WHERE clauses to narrow the results.
Any criticism/advice is welcome

I'de love to expand my knowledge of SQL to avoid these issues in the future.
