• <bdo id='hmYVe'></bdo><ul id='hmYVe'></ul>

    <small id='hmYVe'></small><noframes id='hmYVe'>

    1. <legend id='hmYVe'><style id='hmYVe'><dir id='hmYVe'><q id='hmYVe'></q></dir></style></legend>

        <tfoot id='hmYVe'></tfoot>
      1. <i id='hmYVe'><tr id='hmYVe'><dt id='hmYVe'><q id='hmYVe'><span id='hmYVe'><b id='hmYVe'><form id='hmYVe'><ins id='hmYVe'></ins><ul id='hmYVe'></ul><sub id='hmYVe'></sub></form><legend id='hmYVe'></legend><bdo id='hmYVe'><pre id='hmYVe'><center id='hmYVe'></center></pre></bdo></b><th id='hmYVe'></th></span></q></dt></tr></i><div id='hmYVe'><tfoot id='hmYVe'></tfoot><dl id='hmYVe'><fieldset id='hmYVe'></fieldset></dl></div>

        嵌套聚合函数

        时间:2023-06-06
          <bdo id='uSmjT'></bdo><ul id='uSmjT'></ul>

                  <tbody id='uSmjT'></tbody>

                <small id='uSmjT'></small><noframes id='uSmjT'>

                • <legend id='uSmjT'><style id='uSmjT'><dir id='uSmjT'><q id='uSmjT'></q></dir></style></legend>
                • <i id='uSmjT'><tr id='uSmjT'><dt id='uSmjT'><q id='uSmjT'><span id='uSmjT'><b id='uSmjT'><form id='uSmjT'><ins id='uSmjT'></ins><ul id='uSmjT'></ul><sub id='uSmjT'></sub></form><legend id='uSmjT'></legend><bdo id='uSmjT'><pre id='uSmjT'><center id='uSmjT'></center></pre></bdo></b><th id='uSmjT'></th></span></q></dt></tr></i><div id='uSmjT'><tfoot id='uSmjT'></tfoot><dl id='uSmjT'><fieldset id='uSmjT'></fieldset></dl></div>
                • <tfoot id='uSmjT'></tfoot>

                  本文介绍了嵌套聚合函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..
                  SELECT MAX(AVG(SYSDATE - inv_date)) FROM invoice;
                  

                  这个查询有什么问题?

                  Avg 返回单个值 否Max 需要一个小组来处理,所以它不会执行并给出错误?请解释工作这是一个不会执行的测验问题 我想知道它不执行的原因 我不知道允许嵌套聚合函数吗?

                  Avg returns single value no Max requires a group to work on so it dosent execute and give error? Please explain working It's a quiz question according to which it won't execute I want to know the reason why it dosent execute I can't figure it out nested aggregate functions are allowed right?

                  推荐答案

                  Oracle 允许嵌套聚合函数(参见 文档).

                  Oracle allows nested aggregation functions (see the documentation).

                  然而,它需要一个GROUP BY.所以这是允许的:

                  However, it requires a GROUP BY. So this is allowed:

                  SELECT MAX(AVG(SYSDATE - inv_date))
                  FROM invoice
                  GROUP BY Cust_ID;
                  

                  基本上,这是一个捷径:

                  Basically, this is a short-cut for:

                  SELECT MAX(x)
                  FROM (SELECT AVG(SYSDATE - inv_date) as x
                        FROM invoice
                         GROUP BY Cust_Id
                       ) i;
                  

                  不过,就您而言,没有 GROUP BY.Oracle 不允许在没有 GROUP BY 的情况下嵌套 GROUP BY.

                  In your case, though, there is no GROUP BY. Oracle doesn't allow nested GROUP BY without the GROUP BY.

                  如果您好奇,我不喜欢这种扩展功能.我不认为它实际上解决了问题.

                  And if you are curious, I'm not a fan of this extended functionality. I don't see that it actually solves a problem.

                  这篇关于嵌套聚合函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:SQL 平均(计数(*))? 下一篇:SQL - 使用 ID NOT IN 的高级重复删除

                  相关文章

                  最新文章

                    1. <small id='tDfvT'></small><noframes id='tDfvT'>

                        <bdo id='tDfvT'></bdo><ul id='tDfvT'></ul>

                      <tfoot id='tDfvT'></tfoot>

                      <i id='tDfvT'><tr id='tDfvT'><dt id='tDfvT'><q id='tDfvT'><span id='tDfvT'><b id='tDfvT'><form id='tDfvT'><ins id='tDfvT'></ins><ul id='tDfvT'></ul><sub id='tDfvT'></sub></form><legend id='tDfvT'></legend><bdo id='tDfvT'><pre id='tDfvT'><center id='tDfvT'></center></pre></bdo></b><th id='tDfvT'></th></span></q></dt></tr></i><div id='tDfvT'><tfoot id='tDfvT'></tfoot><dl id='tDfvT'><fieldset id='tDfvT'></fieldset></dl></div>
                      <legend id='tDfvT'><style id='tDfvT'><dir id='tDfvT'><q id='tDfvT'></q></dir></style></legend>