如下sql
SELECT column_name
FROM table_name
WHERE condition
ORDER BY column_name
我现在有字段需如果多条,则需要用逗号隔开
解决方案如下
SELECT LISTAGG(column_name, ',') WITHIN GROUP (ORDER BY column_name)
FROM table_name
WHERE condition;
如下sql
SELECT column_name
FROM table_name
WHERE condition
ORDER BY column_name
我现在有字段需如果多条,则需要用逗号隔开
解决方案如下
SELECT LISTAGG(column_name, ',') WITHIN GROUP (ORDER BY column_name)
FROM table_name
WHERE condition;