By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE students
AS
SELECT 'student1'AS student_name from dual
UNION ALL
SELECT 'student2'AS student_name from dual;
2 rows affected
SELECT LISTAGG('''' || student_name || '''',',')
WITHIN GROUP (ORDER BY student_name) AS r
FROM students;
R |
---|
'student1','student2' |
SELECT LISTAGG(DBMS_ASSERT.ENQUOTE_LITERAL(student_name),',')
WITHIN GROUP (ORDER BY student_name) AS r
FROM students;
R |
---|
'student1','student2' |