I
I
iscateli2022-03-17 13:27:47
Oracle
iscateli, 2022-03-17 13:27:47

How to create your own double header headers in a request?

And then how then how to display 2 headers and query results in dbms.output? Without using SQL*Plus.
2 headers means a line with headings and another line with custom column names

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2022-03-17
@Akina

SELECT {выходные поля запроса}
FROM ( SELECT 3 AS rownumber, {выходные поля запроса}
       FROM {остальное тело запроса} )
     UNION ALL
     ( SELECT 1, {надписи шапки}
       FROM DUAL )
     UNION ALL
     ( SELECT 2, {кастомные названия}
       FROM DUAL )
) AS total
ORDER BY rownumber, {остальные поля сортировки};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question