यदि आप सम्मिलित सूची . के साथ ठीक हैं , फिर LISTAGG . का उपयोग करें जिसे Oracle 11g Release 2
. में पेश किया गया था .
SELECT weekday, LISTAGG(Sched_hrs, ',') WITHIN GROUP (ORDER BY weekday) AS Sched_hrs
FROM table
WHERE emplid = '12345' AND weekday_name= 1
GROUP BY weekday;
उदाहरण के लिए,
SQL> column employees format a50
SQL> SELECT deptno, LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees
2 FROM emp
3 GROUP BY deptno;
DEPTNO EMPLOYEES
---------- --------------------------------------------------
10 CLARK,KING,MILLER
20 ADAMS,FORD,JONES,SCOTT,SMITH
30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
SQL>