版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013084746/article/details/88099850
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