`
yuxuguang
  • 浏览: 136722 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

sql查询另一张表相关联数据出现次数超过4并且查出具体次数

SQL 
阅读更多
select base.c1 baseid,
       base.C700000001 baseschema,
       dp2.turnSentCount,
  from (select dp2.C700020001 baseid, count(*) turnSentCount
          from T92 dp2
         where dp2.C700020011 != '条件' having count(*) > 4
         group by dp2.C700020001) dp2,
       T581 base,
       T92 dp
 where dp2.baseid = base.c1
   and dp.C700020001 = base.c1
   and dp.C700020020 = '1'

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics