Database 中不能直接存Arrray吧?# Database - 数据库
l*r
1 楼
MySQL
For example, I want to create a table like:
FamilyID, Member_Names
10, [Tom, Bob, Kitty]
where Member_Names is of type Array (or list).
Instead, I have to do it like this:
FamilyID, Name
10, Tom
10, Bob
10, Kitty
And when query, aggregate the column Name to a array (list), like "select
Name from my_table where FamilyID = 10", then use the ResultSet to re-create
them into Array (I am using Java).
Am I right?
Thanks a lot.
For example, I want to create a table like:
FamilyID, Member_Names
10, [Tom, Bob, Kitty]
where Member_Names is of type Array (or list).
Instead, I have to do it like this:
FamilyID, Name
10, Tom
10, Bob
10, Kitty
And when query, aggregate the column Name to a array (list), like "select
Name from my_table where FamilyID = 10", then use the ResultSet to re-create
them into Array (I am using Java).
Am I right?
Thanks a lot.