我有一个甲骨文查询:
select * from table1,table2 where table1.id1 = table2.id2 and
--filters
table1.col2 = 'value_11' and table2.col2 = 'value_21'
or
table1.col2 = 'value_12' and table2.col2 = 'value_22'
or
table1.col2 = 'value_13' and table2.col2 = 'value_23'
...
如果过滤条件达到 100,如何重写查询?喜欢(value_11,value_21),(value_12,value_22)......(value_1100,value_2200)
编辑:原始查询是这样的:
select
cust_country.cust_login_id
, cust_country.user_login_id
, cust_country.country_name
, cust_email.email
from ( select
APP_USER.USER_ID, customer.cust_login_id
, user_credential.user_login_id, COUNTRY.COUNTRY_NAME
from
app_user
, user_ci
, contact_info
, address
, country
, customer
, user_credential
where APP_USER.USER_ID = USER_CI.USER_ID
and CONTACT_INFO.CI_ID=USER_CI.CI_ID
and ADDRESS.ADDR_ID=CONTACT_INFO.CI_ID
and ADDRESS.COUNTRY_ID=COUNTRY.COUNTRY_ID
and APP_USER.CUST_ID=CUSTOMER.CUST_ID
and USER_CREDENTIAL.USER_ID=APP_USER.USER_ID
) cust_country,
( select
customer.cust_login_id, APP_USER.USER_ID
, user_credential.user_login_id, ipty_email.email
from
app_user,user_ci,contact_info,ipty_email,customer,user_credential
where APP_USER.USER_ID = USER_CI.USER_ID
and CONTACT_INFO.CI_ID=USER_CI.CI_ID
and ipty_email.ipe_ID=CONTACT_INFO.CI_ID
and APP_USER.CUST_ID=CUSTOMER.CUST_ID
and USER_CREDENTIAL.USER_ID=APP_USER.USER_ID
) cust_email
where cust_country.user_id = cust_email.user_id
and (cust_country.cust_login_id, cust_country.user_login_id) in
(('xxxxyyyyy','ADMIN2'))