在oracle中,sql语句如下:
<pre name="code" class="plain">select * from xa_ajxx where ajxx_uuid not in (select ajxx_uuid from sl_zdajbgxq )
却查不出应有的数据,查询结果为空。
原因是 sl_zdajbgxq中存在着ajxx_uuid为空的数据。导致not in无法查出数据。
改成用not exists即可
select * from xa_ajxx aj where not exists (select ajxx_uuid from sl_zdajbgxq zd where zd.ajxx_uuid = aj.ajxx_uuid)