标题:sql合并
取消只看楼主
cy1210
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-4-26
结帖率:0
已结贴  问题点数:20 回复次数:0 
sql合并
如何将下列两个sql 合成一个简单的sql???

SELECT DPItemId,COUNT(1) idcount
FROM  T
where     DPDate<='2016-04-15'
group by DPItemId
having count(1) <=10
 ) as t


select count(*)  from (SELECT DPItemId,COUNT(1) idcount
FROM T2
where  DPDate<='2016-04-15'
group by DPItemId
having count(1) >10   
and count(1) <=50
) as t

搜索更多相关主题的帖子: 如何 
2016-04-26 21:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-464152-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.220246 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved