内部mysql会把in语句的执行语句转化为exists。
explain select a.* from t_app_digital_parameter a where digital_id in (select id from t_app_digital_product GROUP by product_category)
它会默认的转化为exists语句的查询。
所以对于上述的语句,可以自己写一条使用exists来执行。
explain select a.* from t_app_digital_parameter a where exists(
select b.* from (select id from t_app_digital_product b GROUP by b.product_category) b where a.id =b.id);
explain select a.* from t_app_digital_parameter a where digital_id in (select id from t_app_digital_product GROUP by product_category)
它会默认的转化为exists语句的查询。
所以对于上述的语句,可以自己写一条使用exists来执行。
explain select a.* from t_app_digital_parameter a where exists(
select b.* from (select id from t_app_digital_product b GROUP by b.product_category) b where a.id =b.id);