由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Database 中不能直接存Arrray吧?
相关主题
int or varchar?java sql help!
问个数据库问题Java SQL --> resultset!!
用Servlet显示数据库里的数据,分页的? (很实际的问题)java database access problem!!!
where is ora 00922 from?Access 'memo' data type
how to get the result in the middle of resultset?Re: [转载] JDBC用完了oracle的large pool (memor
请教一个sql server的问题 Help:java call oralce stored procedure
a question for JDBC这二句为什么会抛出ClassCastException异常?
Re: why?ORACLE的c编程中,循环语句中如果出现数据库语句,循环就会死掉请教SQL
相关话题的讨论汇总
话题: familyid话题: name话题: array话题: names话题: member
进入Database版参与讨论
1 (共1页)
l********r
发帖数: 140
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.
I******e
发帖数: 101
2
Yes, that is the typical normalization work of the database.
a*******s
发帖数: 324
3
select familyID, concat_ws(',', Member_Names) from my_table where FamilyID =
10 group by familyID;

【在 l********r 的大作中提到】
: 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

1 (共1页)
进入Database版参与讨论
相关主题
请教SQLhow to get the result in the middle of resultset?
oracle: cartesian product warning请教一个sql server的问题
求助:SQL05 Backup Errora question for JDBC
SQL Server Update Query - non-unique valueRe: why?ORACLE的c编程中,循环语句中如果出现数据库语句,循环就会死掉
int or varchar?java sql help!
问个数据库问题Java SQL --> resultset!!
用Servlet显示数据库里的数据,分页的? (很实际的问题)java database access problem!!!
where is ora 00922 from?Access 'memo' data type
相关话题的讨论汇总
话题: familyid话题: name话题: array话题: names话题: member