group_concat MYSQL新行 [英] group_concat MYSQL new line
本文介绍了group_concat MYSQL新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
group_concat(A,' ',B,' ',C) as Name,
然后使用此php显示
<td><?php echo $row['Name']; ?></td>
使用此查询返回名称X,Y
using this query returns Name X,Y
但是我更喜欢名称不要用逗号分隔,而是换行 X 然后是新行
but i prefer to have the names not comma separated rather line break X then Y new line
有什么主意吗?
推荐答案
我不明白X和Y之间的换行是什么意思,但是如果您需要将值以逗号分隔,则可以在其中添加任何分隔符像这样的 Group_Concat :
I don't understand what do you mean by line break between X and Y, but if you need the values to be comma separated you can add any separator to the Group_Concat like that:
group_concat(Name SEPARATOR ' ') as Name
,这是您可以使用的其他一些分隔符.
这篇关于group_concat MYSQL新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文