【问题标题】:Split list of values for select list in Oracle ApexOracle Apex 中选择列表的拆分值列表
【发布时间】:2014-04-17 18:57:10
【问题描述】:

我正在研究 Oracle Apex,我试图将值列表的结果加载到一个选择列表中,该列表最后是一个组合框。我的代码如下。

select
field1 || ',' || field2 || ',' || field3 as dv, id rv 
from table
where id=1
order by 1

此代码有效,但不是我需要的。我需要在 3 个不同的空格中打印过去的 3 个结果,而不是仅在一行中使用逗号。我如何拆分它并将它们打印在不同的行中,但在与 Oracle Apex 相同的选择列表(组合框)中。

希望你能帮助我。谢谢。

【问题讨论】:

    标签: sql database oracle oracle-apex


    【解决方案1】:

    好吧,如果我理解您的问题,您有一个包含三列的记录,并希望将它们显示为三个不同的行。

    如果是这样,我会这样做:

     select decode(level, 1, field1
                        , 2, field2
                        , 3, field3) display_value
           ,id return_value /* this will return the same ID for each line, please review the logic */
       from table
      where id = 1
    connect by level <= 3
      order by 1
    

    【讨论】:

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