昨天碰到一个sql语句:
select a.*
from (select * from customer_all where cu_type<>'CU') a left outer join customer_link b
on a.customer_code=b.customer_code where ( b.operation_type='AI' or a.cu_type in ('CL','DC','HD','JF','SJ','TR','WH'))
and a.cu_type='CU'
where后面的三个条件随便去掉那个都没问题,没记录,把这个三个条件放在一起,居然查出了数据,因为按select * from customer_all where cu_type<>'CU'来说后面是不存在满足条件a.cu_type='CU'的数据的,实在是搞不懂,惭愧惭愧