0

I tried to do so, but it returns me in columns not rows

SELECT 386 ,417,420,421,422,423 ... from dual 
Bauka
  • 21
  • 1
  • 8
  • Possible duplicate of [How can I select from list of values in Oracle](https://stackoverflow.com/questions/10353969/how-can-i-select-from-list-of-values-in-oracle) – SmartDumb Mar 14 '19 at 08:46

3 Answers3

3

Try this:

select column_value col1 from
table(sys.odcinumberlist((386) ,(417),(420),(421),(422),(423)))
Amir Molaei
  • 3,700
  • 1
  • 17
  • 20
1

use union all

SELECT 386 from dual
union all
SELECT 417 from dual
union all
SELECT 420 from dual
union all
SELECT 386 from dual
Zaynul Abadin Tuhin
  • 31,407
  • 5
  • 33
  • 63
0

You can use UNION or UNION ALL as a work around to get the desired output.

SELECT 386 from dual UNION ALL SELECT 417 from dual UNION ALL SELECT 420 from dual ...

vamosRafa
  • 91
  • 1
  • 6