当前位置:Gxlcms > 数据库问题 > 多表关联sql查询优化

多表关联sql查询优化

时间:2021-07-01 10:21:17 帮助过:31人阅读

select a from A a,B b where a.t=b.t

select a from A a where a.t in (select b.t from B b)

select distinct a.org_code,a.org_name from t_ORGANZATION a,T_DM_CDBP_ORGANZATION b where a.org_code=b.org_code;

select distinct a.org_code,a.org_name from t_ORGANZATION a where a.org_code in(select b.org_code from T_DM_CDBP_ORGANZATION b);

select distinct a.org_code,a.org_name from t_ORGANZATION a where EXISTS (select 1 from T_DM_CDBP_ORGANZATION b where a.org_code=b.org_code);

 

select

(*)1.523s

(1)1.459s

(t.id)1.36s

UNION ALL

多表关联sql查询优化

标签:nbsp   ati   exist   查询   多表   org   表关联   1.4   sele   

人气教程排行