Access SQL 语句优化提速

exists() 语句 条件放在外面提速不少

select *  from T_ZDJZD a where  exists(select * from T_ZDJZX  b where a.ZD_ID=b.ZD_ID and ZD_ID=73090 and a.JZD_ID=b.QS_JZD and a.JZ_XH<>b.JZ_XH)

优化为:

select *  from T_ZDJZD a where  exists(select * from T_ZDJZX  b where a.ZD_ID=b.ZD_ID  and a.JZD_ID=b.QS_JZD and a.JZ_XH<>b.JZ_XH) and a.ZD_ID=73090

 

你可能感兴趣的:(Access,C#,语法)