我有一个有三列的表第一列表示消息id(message_id)第二列表示顺序特征,表示消息的顺序(message_order),最后第三列是消息的片段(message_fragment):
+------------+---------------+------------------------------+
| message_id | message_order | message |
+------------+---------------+------------------------------+
| Message 1 | 2 | Best, Jose |
| Message 1 | 1 | Thanks for your advice |
| Message 2 | 1 | I only have one line of text |
+------------+---------------+------------------------------+
在sql中有没有一种方法可以按消息顺序将消息行连接起来?最终得到以下结果:
+------------+-----------------------------------+
| message_id | message |
+------------+-----------------------------------+
| Message 1 | Thanks for your advice Best, Jose |
| Message 2 | I only have one line of text |
+------------+-----------------------------------+
2条答案
按热度按时间ujv3wf0j1#
对于oracle:
rkue9o1l2#
对于Hive: