标签:一个 select group ext with animal concat listagg agg
animal
id name
1 dog
1 cat
2 lion
怎么得到相同id的name list呢?也就是想得到id 为1的list为dog, cat格式。
1. 首先Oracle有一个方法,wm_concat()
SELECT department_id "Dept.", LISTAGG(last_name, ‘; ‘) WITHIN GROUP (ORDER BY hire_date) "Employees" FROM employees GROUP BY department_id ORDER BY department_id;
Oracle 多行连接成一行 convert multiple rows to one row
标签:一个 select group ext with animal concat listagg agg
原文地址:http://www.cnblogs.com/FANKIKI/p/7486886.html