【问题标题】:How to make dual table with many rows in one col?如何在一个列中制作多行的双表?
【发布时间】:2019-08-04 22:39:21
【问题描述】:

我尝试这样做,但它以列而不是行返回我

SELECT 386 ,417,420,421,422,423 ... from dual 

【问题讨论】:

标签: sql oracle select


【解决方案1】:

试试这个:

select column_value col1 from
table(sys.odcinumberlist((386) ,(417),(420),(421),(422),(423)))

【讨论】:

    【解决方案2】:

    使用union all

    SELECT 386 from dual
    union all
    SELECT 417 from dual
    union all
    SELECT 420 from dual
    union all
    SELECT 386 from dual
    

    【讨论】:

      【解决方案3】:

      您可以使用UNIONUNION ALL 作为变通方法来获得所需的输出。

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多