concat_ws collect_set 排序
时间: 2023-10-08 17:05:21 浏览: 177
根据引用\[1\]和引用\[2\]的内容,可以使用concat_ws函数结合collect_set函数来进行排序。首先,将collect_set函数改为collect_list函数或sort_array函数进行排序。例如,使用sort_array(collect_set(t.class), false)来对字段进行排序。然后,使用concat_ws函数将排序后的字段进行拼接。最后,根据需要使用group by语句对结果进行分组。这样就可以实现concat_ws和collect_set的排序功能。引用\[1\]\[2\]
#### 引用[.reference_title]
- *1* [SQL之concat()、collect_set()、collect_list()和concat_ws()用法](https://blog.csdn.net/weixin_48272780/article/details/128243152)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [hive中的拼接函数(concat,group_concat,concat_ws,collect_set)](https://blog.csdn.net/zll_1234/article/details/106329025)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [hive concat_ws列转行排序问题](https://blog.csdn.net/qq_37067752/article/details/125238271)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文