Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

How to show SQL output in 1 ROW instead of normal multiple lines with ORDER BY?

SebaVastaFeb 20 2024

How to show 3 rows from this SQL in one line like “B, B, A”. Our DB is 11g R2.

SELECT f1
FROM
(
SELECT 'A' f1, 1 f2 FROM DUAL
UNION ALL
SELECT 'B' , 3 FROM DUAL
UNION ALL
SELECT 'B' , 2 FROM DUAL
)
ORDER BY F2 DESC ;

This post has been answered by Frank Kulash on Feb 20 2024
Jump to Answer
Comments
Post Details
Added on Feb 20 2024
3 comments
148 views