zoukankan      html  css  js  c++  java
  • oracle解决多表关联分组查询问题

    做了一个功能需要分组查询,同时查询A表分组查询的ID需要关联B表的数据,本来想两个表关联查询,但是报group by 语法不正确。所以做了以下修改。

    select count(*), cindexid,(select vindexcode from comindex where pk_index =cindexid) as vindexcode ,iquesttype 

      from rqt_examquest 

        where pk_examquest in

             (
                   select cexamquestid

                  from rqt_examquest_b2

                    where cjobtypeid = '1000LSZY123456100001' or cjobtypeid='1001LSZYp3U34Bxgv7V4'
             )

        group by cindexid , iquesttype having iquesttype = 1 or   iquesttype = 2 or    iquesttype = 3

        order by cindexid

  • 相关阅读:
    斐波那契数列
    进制转换为伪代码
    python模拟进程
    第十一周学习总结
    第十周学习总结
    第九周学习总结
    俄罗斯方块
    熟悉编程语言
    小学四则运算
    第八周学习总结
  • 原文地址:https://www.cnblogs.com/shengs/p/3831541.html
Copyright © 2011-2022 走看看