ename empno deptno
amar 1 10
akbar 2 20
anthonny 3 30
jonathan 4 40
write a procedure to dispaly the column values ina row
separated by a
deleimiter
eg - input - select ename from emp '|' output -
amar|akbar|anthony|jonathan
input - select empno from emp '@' o/p - 1@2@3@4
input - select deptno from emp '/' o/p -
10/20/30/40
Pls answer this questn.
Answer Posted / sujatha nulu
Hi,
We have well advanced concepts in Oracle to achieve this.
LISTAGG analytical function can be used for this.
If its ename to be concatenated yet separated by delimiter,
use this way;
SELECT LISTAGG(ename,'|')
WITH IN GROUP (ORDER BY DEPTNO)
FROM EMPLOYEES
GROUP BY DEPTNO
ORDER BY DEPTNO;
You can write a procedure and pass column, delimiter as
parameters.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is PL/SQL Records?
Explain alias in sql?
What is the unique index?
What is a natural join?
Can we create table in function?
How many sql databases can you have on one server?
What is your daily office routine?
What is raid? How does it help storage of databases?
What is the reports view in oracle sql developer?
how to create a new view in mysql? : Sql dba
Why function is used in sql?
How delete a row in sql?
what is cross join? : Sql dba
Does oracle use sql?
How many postgresql users are there, worldwide?