oracle数据库优化

oracle中查询重复记录
select msisdn from us_userinformation u
where u.rowId > (select min(us.rowId)
from us_userinformation us
where us.msisdn = u.msisdn);

使用exists代替in查询
select count(msisdn) from us_userinformation u where u.msisdn in (select m.msisdn from us_markinfo m);
select count(u.msisdn) from us_userinformation u where exists (select 1 from us_markinfo m where u.msisdn = m.msisdn);

你可能感兴趣的:(oracle)