select distinct * from person,addr,contract where instr(lower(per_name),'john')>0 and con_type = 'I' and con_tin = per_ssn and con_number = add_num and (add_type in ('01','29') or add_address_type = '02')
select * from person,addr,contract where lower(per_name) like '%john%' and con_type = 'I' and con_tin = per_ssn and con_number = add_num and (add_type = '01' or add_address_type = '02' or add_type = '29') group by person.OPERATION
把这个优化了。。
distinct *
from
person,addr,contract
where
instr(lower(per_name),'john')>0 and
con_type = 'I' and
con_tin = per_ssn and
con_number = add_num and
(add_type in ('01','29') or add_address_type = '02')
*
from
person,addr,contract
where
lower(per_name) like '%john%' and
con_type = 'I' and
con_tin = per_ssn and
con_number = add_num and
(add_type = '01' or add_address_type = '02' or add_type = '29')
group by person.OPERATION
hope it's helpful !