SQL 查询到 Concat 输出
我还有一个 SQL 问题,希望这里有人可以帮助我。
我有以下 mysql 表:
ID Type Result
1 vinyl blue, red, green
1 leather purple, orange
2 leather yellow
并且我正在寻求以下输出:
ID Row One Row Two
1 vinyl blue, red, green leather purple, orange
2 leather yellow
问题是...类型不是静态的...有许多不同的类型,并且并非所有类型都有相同的类型。他们需要按顺序遵循。
I have an addition SQL question, hopefully someone here can give me a hand.
I have the following mysql table:
ID Type Result
1 vinyl blue, red, green
1 leather purple, orange
2 leather yellow
and i am seeking the following output:
ID Row One Row Two
1 vinyl blue, red, green leather purple, orange
2 leather yellow
the thing is... type is not static... there are many different types and not all of them have the same ones. They need to follow in order.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请发布您的表的显示创建表。事实上并不清楚你的意思。
也许您最终需要的是 GROUP_CONCAT:
请告诉我们。
Please post a show create table of your table. It's not clear what you mean in fact.
Maybe what you need is GROUP_CONCAT after all:
Let us know.