![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
SELECT deptno, 2 substr(REPLACE(REPLACE(xmlagg(xmlelement("x", job) ORDER BY |
#2
| |||
| |||
|
|
SELECT deptno, 2 substr(REPLACE(REPLACE(xmlagg(xmlelement("x", job) ORDER BY job), '</x>'),'<x>', ' '), 2) job_list 3 FROM emp 4 GROUP BY deptno 5 ORDER BY deptno 6/ DEPTNO JOB_LIST ------ ---------------------------------------------------- 10 CLERK MANAGER PRESIDENT 20 ANALYST ANALYST CLERK CLERK MANAGER 30 CLERK MANAGER SALESMAN SALESMAN SALESMAN SALESMAN How can I get result like this: (distinct names in "job_list") ? DEPTNO JOB_LIST ------ ---------------------------------------------------- 10 CLERK MANAGER PRESIDENT 20 ANALYST CLERK MANAGER 30 CLERK MANAGER SALESMAN |
#3
| |||
| |||
|
|
How can I get result like this: (distinct names in "job_list") ? DEPTNO JOB_LIST ------ ---------------------------------------------------- * * 10 CLERK MANAGER PRESIDENT * * 20 ANALYST CLERK MANAGER * * 30 CLERK MANAGER SALESMAN |
#4
| |||
| |||
|
|
On Mar 12, 4:58 pm, webtourist<webtour... (AT) gmail (DOT) com> wrote: snip How can I get result like this: (distinct names in "job_list") ? DEPTNO JOB_LIST ------ ---------------------------------------------------- 10 CLERK MANAGER PRESIDENT 20 ANALYST CLERK MANAGER 30 CLERK MANAGER SALESMAN Are you running 7.3.4? |
#5
| |||
| |||
|
|
Are you running 7.3.4? |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |