全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SQL及关系型数据库数据分析
1517 0
2015-07-28
有没有大神解释一下这个嵌套语句的意思?
SELECT  DISTINCT b.id,DATE_FORMAT(b.gmt_modified,'%Y-%m')
from  biz_order a
LEFT JOIN shop b on  a.shop_id=b.id
LEFT JOIN china_community c  on a.community_id=c.community_id   
where  a.gmt_create BETWEEN '2014-11-15 00:00:00'  and '2015-07-26 23:59:59'

and a.`status` =4
and a.address_snapshot not  like '%测%'
and a.buyer_nick not like  '%测%'
and a.`comment` not like  '%测%'

and a.shop_id not in  (139,248,510,483,21,52,900,1572,1870,1570,3693,3529,3573)
and b.`status`<100
and a.shop_id not in
(
SELECT DISTINCT b.id
from  biz_order a
LEFT JOIN shop b on  a.shop_id=b.id
LEFT JOIN china_community c  on a.community_id=c.community_id   
where  a.gmt_create BETWEEN '2015-06-27 00:00:00'  and '2015-07-26 23:59:59'

and a.`status` =4
and a.address_snapshot not  like '%测%'
and a.buyer_nick not like  '%测%'
and a.`comment` not like  '%测%'

and a.shop_id not in  (139,248,510,483,21,52,900,1572,1870,1570,3693,3529,3573))


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群