0

I have a table say t1

I have columns A1,A2,a3,a4,a5

I need output like

A -column name 
  
A1-value in a1
A2-value in a2
A3
A4  
Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • Does this answer your question? [Oracle SQL Columns to Rows without UNPIVOT](https://stackoverflow.com/questions/41845825/oracle-sql-columns-to-rows-without-unpivot) – astentx Jun 30 '21 at 08:45

1 Answers1

0

Looks like UNION.

select a1 as a from t1 union all
select a2      from t1 union all
select a3      from t1 ...
Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • Union will work in case of single column , I have to convert three columns like this which gives error single row sun query returns more than one row.. – Anshul Pratap Singh Jun 30 '21 at 08:11
  • Well, "example" you posted isn't descriptive at all (from my point of view) so I answered the way I understood the question. If there are more columns to be involved, just add them into every SELECT statement. Or, edit the question and provide sample data which nicely describe what you have and what you'd want to get out of it. – Littlefoot Jun 30 '21 at 08:15