[英]Oracle Apex multiple value in Column
I'm having a text field with comma sepeated values in my Oracle Apex page (eg "F01C, F01D, G01A"). 我的Oracle Apex页面中有一个带有逗号分隔值的文本字段(例如“ F01C,F01D,G01A”)。 The values are stored in only one column of my table (Table: HC_DEFHANDBUCH_B5 Column DRG).
这些值仅存储在表的一列中(表:HC_DEFHANDBUCH_B5列DRG)。
------
PK_ID OPS MDC DRG OPS_FILL MDC_FILL YEAR
214098 1-100 2 C01A, C01B, C14Z 1-100 2 2017
214099 - 15 P67D 1-100 15 2017
214100 1-204.2 15 P67D 1-204.2 15 2017
214101 1-204.3 15 P67D 1-204.3 15 2017
-------
I tried to run a query in an interactive report to select all DRGs for PK_ID '214098' from the Table HC_GDRG_FPK which is having one Row per DRG: 我试图在交互式报表中运行查询以从表HC_GDRG_FPK中为PK_ID'214098'选择所有DRG,其中每个DRG都有一行:
Select * FROM HC_GDRG_FPK a
WHERE a.DRG IN (Select '(''' || REPLACE(b.DRG,', ',''', ''') || ''')' FROM HC_DEFHANDBUCH_B5 b WHERE b.PK_ID='214098')
AND a.Jahr='2017'
Does anyone have an idea how to get this working? 有谁知道如何使它工作? I get it working on a single value.
我得到它工作在一个单一的价值。
Thanks in advance. 提前致谢。
I could finally solve it with regular expressions. 我终于可以用正则表达式解决它。 @Justin Cave: Thanks for the hint.
@贾斯汀·凯夫:谢谢你的提示。
select * from HC_GDRG_FPK where DRG in (
select regexp_substr(:P39_CALL_DRGS,'[^,]+', 1, level) from HC_DEFHANDBUCH_B5
connect by regexp_substr(:P39_CALL_DRGS, '[^,]+', 1, level) is not null )
AND Jahr ='2017'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.