Am 03.03.2010 08:12, schrieb Randal L. Schwartz: >>>>>> "D" == D Cooper Stevenson <[email protected]> writes: > > D> I have three tables entitled, "msft," "goog," "aapl," and "intc." Each > D> of these tables are in the same database entitled, "minute." > > Tables with the same structure with different names are an indication that > you're confusing data with structure. In this case, "goog" is really a data > item, not a structure item, so it should be a column in the table, not the > name of the table. > > However, if you *needed* these tables separate (for datawarehousing for > example), and you were using Postgresql (which I recommend wholeheartedly over > MySQL except when compatibility is a must), you could partition your tables as > an inherited structure, so that querying "stocks" would essentially be a union > of all stock-derived tables.
Yes, good point. The only time I ever used UNION was in a SmartPlant P&ID system, where they have 4 different tables that store the same types of data for 4 different kinds of equipment (vessel, mechanical, electrical, and something else I can't remember). What a god-awful schema that was. Carlos _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
