【发布时间】:2017-09-01 09:26:26
【问题描述】:
想法是我有一个临时表:
Type | Sources
Invoices | 44,22,11
Billings | 99,90,12,34
在我的应用程序中(交互式报告内有交互式报告的顶点),用户单击一行图标:账单发票。在我的 plsql 查询中,我得到值 #type# 和 #sources# 作为结果(它们将被顶点注入适当的值)。我想实现这样的目标:
select
case when #type# = 'Billings'
then (select from table_billings where table_billings.sources = #sources#)
when #type# = 'Invoices'
then (select from table_invoices where table_invoices.sources = #sources#)
我对如何做到这一点有很大的问题,因为事实上,我的主要选择来自 NOTHING,只有内部的有一些表。另一方面,我不能从 dual 使用,因为列数和行数可能会有所不同。有什么想法吗?
【问题讨论】:
-
我的建议是规范化您的表格并删除该 CSV 数据。它将使查询和维护成为一场噩梦。
-
@TimBiegeleisen 不幸的是,这个 Sources 列是在 groupby 期间生成的,我对此无能为力。
标签: oracle plsql oracle-apex