Apologies if I am mistaken, but is there any way to create a table inside a column in MySql?
Brief: I have a table named test_table
which contains a column named name test_column
. Now I want to create a table inside test_column
. Is this possible?
Thanks In advance
That approach is not possible. What you are looking for is a second table that is linked using a field in the first table.
Example:
test_table:
test_table2:
You can then access them using
JOIN
commands. For example:This way you can have multiple rows for each ID in table 1, which has the effect you are looking for.
No nested tables in MySql, but there is a SET datatype that you can use in a table
http://dev.mysql.com/doc/refman/5.0/en/set.html
This is not possible in MySQL.
You would create a "child" table with an id that is referenced in the column of the main table. You wouldn't create a "table" in a column.
For example
then you just join the tables based on that fk id. You can have multiple fk column in the first table that link to different child tables. You can also look in to SET data types in MySql although I wouldn't recommend them.
btw, If your question is MySql specific then you shouldn't use the oracle tags.