


If I use your suggestion now, Progman, I would have one huge table, where the composition of timestamp (a DATETIME) and the id from "test" table are my PK. And it is possible, that at certain points there will come new measuring stations, which should be also recorded. I need a table where i save all these values (including the measured temperatures for the last 20 years!) corresponding to the time recorded ("timestamp"). The table "test" gives me, first column: an ID, second column: the name of, let's say a measuring station and third column: a number, which is the amount of temperature sensors at this measuring station.Įach Sensor at each station saves the temperature every 15 minutes. The resulting tables for the three entries above should look like these: CREATE TABLE numbers1 (Īny idea? Maybe just a hint, if it is possible and if yes, where I should have a closer look in the SQL field?! Later I want to use a trigger for the automatization.
#MYSQL CREATE TABLE INTEGER COLUMN HOW TO#
I now how to create a new table with entries from another table, but i can't find anything about new tables with columns depending on an index in another table. Unfortunately I am very new to mySQL and have no idea, how to do it. This is an example for the test table: DROP TABLE IF EXISTS test I want that every time, a row is added to the table "test" a new table is created with the tablename "numbersX", where X is test.id and with columns "time", "number1", "number2", "number3". "number" is an integer number for each row. So more specific: I have the table "test" with columns "ID", "name" and "number". Pellentesque dapibus efficitur laoreet.I have a table and every time a row is added to this table a new table should be created with an amount of columns depending on an entry of the first table. Nam lacinia pulvinar tortor nec facilisis. Nam risus ante, dapibus a molestie conssectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Nam risus ante, dapibus a molestisectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipisectetur adipiscing elit.

Nam risus ante, dapibus a molestie csectetur adipiscing elit.

Pellentesque dapibus efficisectetur adipiscing elit.
