select '合同生成' t_type , sum(contract_generate_qty) as qty from JKS_OTC_ADS.ADS_ORDER_OVERVIEW_DI tt where 1 = 1 <v_region_name> and REGION_NAME in (?{v_region_name})</v_region_name> <v_date_start>and tt.work_date > ?{v_date_start}</v_date_start> <v_date_end>and tt.work_date < ?{v_date_end}</v_date_end> <v_customer_name>and tt.customer_name in (?{v_customer_name})</v_customer_name> <v_product_name>and tt.product_name in (?{v_product_name})</v_product_name> <v_contract_no>and tt.contract_no in (?{v_contract_no})</v_contract_no> <v_order_no>and tt.order_no in (?{v_order_no})</v_order_no> <v_time_type>and tt.time_type in (?{v_time_type})</v_time_type>
解决思路大至有两种,一种是换用JOIN或者EXIST,另一种是仍然用IN,但是把条件分成多个少于1000的IN即:SELECT * FROM DUAL T WHERE T.DUMMY IN ('1', '2', '3',...,'1000') OR IN ('1001', '1002', ..., '2000') OR ...
————————————————
版权声明:本文为CSDN博主「caolipeng_918」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/caolipeng_918/article/details/18823533