Actually vertical tables are not much like pivot tables. They are a way to store data where the schema (the columns names) changes frequently or is not known ahead of time.<br><br>This might give away the presentation, but here's how it works:<br>
<br>You create one table to store the field names:<br><br>Field Names Table:<br> id<br>
field_name<br><br>Then another table for the data:<br><br>Data Table:<br> id<br> record_id<br> field_id<br> data<br><br>Each "record" in the vertical table, gets broken down into multiple rows in the "Data" table. Each row in the "Data" table then references a "Field" type and contains a piece of data. This is the equivalent of a column value in a regular, horizontal table. These records are tied together into on "virtual row" by the "record_id".<br>
<br><br>-Mike Frager<br><br><br><div class="gmail_quote">On Mon, Jul 11, 2011 at 10:44 AM, Randal L. Schwartz <span dir="ltr"><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">>>>>> "Mike" == Mike Frager <<a href="mailto:mfrager@gmail.com">mfrager@gmail.com</a>> writes:<br>
<br>
</div>Mike> By doing this you can change the schema on the fly.<br>
<br>
I've always wanted my flies to have different schemas!<br>
<br>
Mike> It's likely something you may have seen before, but under a<br>
Mike> different name. Usually worth a look though. Since I first<br>
Mike> learned about it, it has greatly helped how I think about<br>
Mike> databases.<br>
<br>
Pivot tables, maybe?<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Randal L. Schwartz - Stonehenge Consulting Services, Inc. - <a href="tel:%2B1%20503%20777%200095" value="+15037770095">+1 503 777 0095</a><br>
<<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>><br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.posterous.com/" target="_blank">http://methodsandmessages.posterous.com/</a> for Smalltalk discussion<br>
</div></div></blockquote></div><br>