QuestionQ63

VerifiedReporting Aggregated Data Using the Group Functions

Which statement returns a comma-separated, alphabetically ordered list of employee names for every department in the EMP table?

Explanation

LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) concatenates employee names with commas in alphabetical ENAME order. GROUP BY deptno creates a separate aggregated list for each department. Oracle documents that LISTAGG orders values within each group using its ORDER BY clause before concatenating them.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!