I wrote 3 queries:
select column1 from table_name1 where -- conditions)
||' TEXT2: '|| (select column2 from table_name2 where -- conditions)
||' TEXT3: '|| (select column3 from table_name3 where -- conditions)
This seems to work. Here is the output:
column1 'TEXT2:' column2 'TEXT3:' column3
I tried to use CHR(09)
, but I think I can't use it properly or it's not working with our system - the 3 select statements are part of an internal query in our system in EAS (-enterprise application software) - I tried it with this format query1||CHR(09)||query2
but it doesn't put the tab
into the output.
Expected output in rows:
'TEXT1:' column1||tab character||'TEXT2:' column2||tab character||'TEXT3:' column3
Maybe i should try to use lpad(' ',8)
to put whitespace into it ?
How can i achieve the expected output ?
Assuming that the type of all 3 columns is text(
VARCHAR2/CHAR
) , you may first do aUNION ALL
and then applyLISTAGG
withCHR(9)
as delimiter.