使用字符串值而不是整数对 id 进行分组 SQL GROUP BY
在谷歌上,我刚刚找到了按总和(整数值)分组。如何按字符串值分组?对于表格:
No Place Car
--- ------ --------
1 NY VRM1
1 BT VLI
2 NY GAR
3 GT GAR
如何按“否”分组?我尝试过:
SELECT No, place, Car
FROM APPEL
GROUP BY No, Place, Car
但没有成功。
我想要一张这样的桌子
No Place Car
--- ------ --------
1 NY,BT VRM1,VLI
2 NY GAR
3 GT GAR
On Google I just found group by sum (integer value). How can I group by a string value? For the table:
No Place Car
--- ------ --------
1 NY VRM1
1 BT VLI
2 NY GAR
3 GT GAR
How can I group by 'No'? I tried:
SELECT No, place, Car
FROM APPEL
GROUP BY No, Place, Car
But it didn't work.
I want to have a table like this
No Place Car
--- ------ --------
1 NY,BT VRM1,VLI
2 NY GAR
3 GT GAR
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)