Oralce 多行数据合并一行

废话不多说,上教程。🤩


语法:listagg(columnName,',') within group (order by columnName)

示例:select listagg(columnName,',') within group (order by columnName) columnName1 from tableName

如果有 乱码的情况 加上to_char(columnName)

完整示例:select listagg(columnName,',') within group (order by columnName) columnName1 from tableName


到这里就🎉🎉🎉大功告成了!🎉🎉🎉 你学废了吗😀
posted @ 2024-07-25 14:52  浅·笑  阅读(17)  评论(0编辑  收藏  举报