【发布时间】:2016-06-10 11:29:55
【问题描述】:
我有一个表,列有“ID”、“Plans”、“Type”、“Type_id”
ID | Type | Plans | Type_id
_____________________________________
1 | Package | Gold | 3
1 | Package | Silver | 2
1 | Package | Platinum | 4
1 | Channel | HollywoodOn | 200
我想要这样的输出:
ID | Type | Plans
_____________________________________
1 | Package | Gold,Silver,Platinum
1 | Channel | HollywoodOn
请帮助伙计们。谢谢。 P.S:对不起,我以前发布的愚蠢格式。我是堆栈溢出的菜鸟。
【问题讨论】:
-
考虑使用
group_concat和group by -
感谢 Reddy 成功了
标签: mysql database select jdbc records