Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1953769
  • 博文数量: 176
  • 博客积分: 1857
  • 博客等级: 上尉
  • 技术积分: 2729
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-14 22:55
个人简介

吾生有涯,而知无涯,适当止学.循序渐进,步步提升 Talk is cheap, show me the code.

文章分类

全部博文(176)

文章存档

2019年(1)

2018年(14)

2017年(20)

2016年(31)

2015年(15)

2014年(5)

2013年(10)

2012年(80)

分类: Mysql/postgreSQL

2012-08-14 10:47:47

内部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);
阅读(2217) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~