如何在Oracle Apex经典报表中使用IN运算符

时间:2018-11-14 10:55:25

标签: oracle oracle-apex oracle-apex-5.1

我想在oracle apex经典报表中的运算符中用于对明细数据以及多个明细数据进行排序。所以我该如何通过sql查询呢? 请帮助我。

SELECT fr_st_invoiceno,
      sales_type,
      cust_id,
      sia_id,
      coll_amount,
      remarks,
      cash_bank,
      bank_name,
      check_no,
      update_id,
      updatedate,
      slno,
      invoice_type,
      trcode,
      send_voucher_no,
      send_voucher_no_depot
FROM dis_invoice_tk_collection
WHERE position = 1
      AND   fromstore_id =:p157_depot
      AND   send_voucher_no IN (:p157_send_voucher_no)

谢谢! 。

2 个答案:

答案 0 :(得分:0)

您必须将以逗号分隔的值分成几行,例如

and send_voucher in
  (select regexp_substr(:P157_SEND_VOUCHER_NO, '[^,]+', 1, level)
   from dual
   connect by level <= regexp_count(:P157_SEND_VOUCHER_NO, ',') + 1
  )

假设P157_SEND_VOUCHER_NO看起来像10,20,30

请不要忘记将P157_SEND_VOUCHER_NO项目放入“要提交的页面项目”属性中。

答案 1 :(得分:0)

AND   instr(','||:p157_send_voucher_no||',', ','||send_voucher_no||',') > 0