Is this a bug with the grouping sets?

Version is the database of Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
SQL> with data as
  2  (select rownum r, 'X' x, 1 n from dual connect by rownum <= 10)
  3  select x
  4       , sum(n) s
  5       , (select sum(1) from dual where dummy = x) t
  6  from data
  7  group by grouping sets (x, ())
  8  /

X          S          T
- ---------- ----------
X         10          1
          10
SQL>  
Shouldn't the superaggregate row have a 1 in the T column?

Here's your QUERY with the addition of the GROUPING() function:

SQL> WITH data AS
  2  (
  3     SELECT rownum r
  4          , 'X'    x
  5          , 1      n
  6     FROM   dual
  7     CONNECT BY rownum <= 10
  8  )
  9  SELECT GROUPING(x)
 10       , x
 11       , sum(n) s
 12       , (SELECT sum(1) FROM dual WHERE dummy = x) t
 13  FROM   data
 14  GROUP BY GROUPING SETS (x, ())
 15  ;

GROUPING(X) X          S          T
----------- - ---------- ----------
          0 X         10          1
          1           10

In this case, the value of X is zero because it is a subtotal line. If you look at this statement execution plan:

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gumphwvgumqc4, child number 0
-------------------------------------
WITH data AS (  SELECT rownum r       , 'X'    x       , 1      n  FROM
  dual  CONNECT BY rownum <= 10 ) SELECT /*+gather_plan_statistics*/ x
    , sum(n) s      , (SELECT sum(1) FROM dual WHERE dummy = x) t FROM
 data GROUP BY GROUPING SETS (x, ())

Plan hash value: 1718326399

-----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                       | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                |      |      1 |        |      2 |00:00:00.01 |       0 |    |  |          |
|   1 |  SORT AGGREGATE                 |      |      2 |      1 |      2 |00:00:00.01 |       4 |    |  |          |
|*  2 |   TABLE ACCESS FULL             | DUAL |      2 |      1 |      1 |00:00:00.01 |       4 |    |  |          |
|   3 |  SORT GROUP BY ROLLUP           |      |      1 |      1 |      2 |00:00:00.01 |       0 |  2048 |  2048 | 2048  (0)|
|   4 |   VIEW                          |      |      1 |      1 |     10 |00:00:00.01 |       0 |    |  |          |
|   5 |    COUNT                        |      |      1 |        |     10 |00:00:00.01 |       0 |    |  |          |
|   6 |     CONNECT BY WITHOUT FILTERING|      |      1 |        |     10 |00:00:00.01 |       0 |    |  |          |
|   7 |      FAST DUAL                  |      |      1 |      1 |      1 |00:00:00.01 |       0 |    |  |          |
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter("DUMMY"=:B1)

The value of X is related to the subquery. If X is zero this returns no rows (I'm sure you already knew that :)). I would say it should although confusing behavior. You get the same results if you use CUBE or ROLLUP as well.

Tags: Database

Similar Questions

  • Is there a bug with the maintenance of interaction of the Glossary for the entire project?

    Greetings,

    I've seen in other posts (Cp6) that there is a known bug with the maintenance of interaction available in a project glossary.

    Maybe my problem can help further this question - or maybe someone can post tips on how to solve this problem.

    I use a trial version of the Cp7 and followed the advice in this tutorial: http://www.YouTube.com/watch?v=wTEF-56V1Z4

    I found that if I left 'Visible output' box unchecked for the button closure (as in the tutorial), I don't see the glossary at all.

    Similarly for the button I created for the glossary - I couldn't have hidden or I don't see it.

    Another problem: the close button in the glossary (which is grouped in the interaction) in a first time appeared with the glossary, but then decided to appear on following slides without it (but in the same location).

    Everyone has been able to follow the advice on the above tutorial link successfully and is there another tutorial I can watch or read about it? I really want to provide access to the glossary on multiple slides and during quizzes. (And Yes, I'll buy a license - although the number of bugs I encounter creeps upward!)

    Thank you

    Jacqui.

    Hello

    Unchecking 'visible output' means the Group glossary will be invisible in the output until it is made visible by an action. In this case, the action that make visible is assigned to the Glossary button.

    Make sure that:

    • Glossary button, button Exit and the Widget are defined "Rest of project" accordion Timing.
    • EXIT button is set to Place object on top in the accordion of Timing.

    Anthony

  • Bug with the embedded font.

    Hello


    I have a strange bug with the font Cooper (Std Black Italic)...

    Here's what looks like a multiline text in the Flash Editor:

    mlVXh7W.png

    Now, here's how it looks when I embed the fonts in a SWF file, and then load and use from the AS3 code:

    hXbpJ3S.png

    [this] is happening?

    Here are the parameters of line values I get from getLineMetrics (0):

    Ascent: 51.2

    descent: 51.2

    height: 102.4

    head: 0


    I tried to reexporting the police, the same problem. I also have the same problem when I export the scene editor and read it with Ctrl + Enter.

    It seems THAT the good in the editor... I don't know what to do. I reinstalled even the police. :/

    Also, I have this problem with all fonts... or at least every 5 different fonts, I tried.


    [moderate]

    I finally fixed it by recreating the Mac fla file.

    Looks like it is a problem with Windows.

  • Detection of colliding with the grouped shapes

    Hello world.
    I'm having a problem with collision detection.
    I do an underwater game where the submarines are groups of shapes (two ellipses and two small rectangles).
    I use a circle (IARC) object for the missiles.


    It detects collisions when I do this:
    //////////////////////////////////////////////////
    If (circ.intersects (sub.getBoundsInLocal ()))
    {
    System.out.println ("you been touched");
    Returns true;
    }
    /////////////////////////////////////////////////



    Or it detects collision if I do:
    ////////////////////////////////////////////////
    If (sub.getChildren () .get (2) .intersects (circ.getBoundsInLocal ()))
    {
    System.out.println ("you been touched");
    Returns true;
    }
    ///////////////////////////////////////////////////////////////////////
    (the child in the 2 index is the main body of the Sub - ellipse shape)



    If I add an object not grouped as a simple rectangle shape and check the collisions on it then it detects very well. 'r' is the rectangle object.
    ////////////////////////////////////////////////////////////////////////
    If (circ.intersects (r.getBoundsInLocal ()))
    {
    System.out.println ("you hit sucker");
    Returns true;
    }
    ///////////////////////////////////////////////////////////////////////////



    Can we see why it will not work with the grouped shapes or a child of the Group? Or y at - it a simpler way that I'm missing?

    Thanks a lot :)

    For a group shape, use the boundsInParent property.

        circ.intersects(sub.getBoundsInParent())
    
  • OR DC Soft Front Panel, minorbug, small bug with the PXI-4110

    Hello

    The NI DC Soft Front Panel V14.0, with the PXI-4110, scrolling to negative tension, works as expected to-10V, but then returns to 0. If we change from - 1V procedure, it goes...-8-9,-10, -1, -2... instead of-8-9,-10, -11, -12...

    Everything about her, a simple thing that I miss is a switch for all three voltages.

    (Also, IMO, it would be logical for negative tensions with the arrow pointing down, not more).

    My 2 c

    Hello Janaf,

    I completely agree with two of your statements, I tabled a report of corrective measures that you can monitor in the next versions of DCPower to see if this is fixed with the FPS. CAR number: 512257

    I've added notes that only manual insertion of numbers - less than 10 works and that it was not logical to use arrow increment or upward arrow to reduce the output voltage.

  • I can't import my script (film) into Adobe Story. The error message says that I am unable to connect to the Adobe servers. Is this a problem with the Adobe?

    I can't import my script (film) into Adobe Story. The error message says: I am unable to connect to the Adobe servers. Is this a problem with the Adobe?

    Yes and no it seems that if the file is a .doc or .pdf, that it does not load properly. But if I bring him in a Final Draft format, it works perfectly.

    Adam

    Sent from my iPhone

  • Suggestions to overcome this problem: a bug with the HTTP PATCH request with data on the body

    Hello guys,.

    I'm really stuck with a problem and I'm looking for suggestions for solutions and help implementingit.

    In summary:

    (1) the third REST API that I use use HTTP PATCH with the JSON data.

    2) there is a bug in Qt 4.8 that prevents me from using the http verb.

    (3) one of the main features of my new app is severely compromised because of this.

    (4) I found an independent patch to the bug in question.

    What are my options now?

    (A) should I patch Qt reconpile and 1980s, me with my application? I have no experience with these procedures.

    (B) is it possible that I can only implement the elements of fastening of the patch in my application code? I don't see how.

    (C) request and wait for BlackBerry for the patch and release it on the next update? That imensily would limit my clients, only running 10.3.3 and I was 10.3.0.

    (D) any other alternative!

    As I said, I'm really stuck now. I was able to realease my app without this big news, but it would be a great disappointment.

    Any help is appreciated.

    Thanks in advance.

    Here's the code in a Stackoverflow thread on the same topic, I can't try it myself, but let us know if it works and mark @oniongarlic response as a solution if it works.

    Thread: http://stackoverflow.com/questions/34065735/qnetworkaccessmanager-how-to-send-patch-request

    Code:
    QString destination ="";
    currentNode.replace(QString("/").append(latestNode),""); "
    destination
    . Append (Host)
    . Append (CurrentNode)
    . Append(".) JSON");
    QString jsonString=QString(QString("{").append("\"").append(latestNode).append("\"").append(":").append("\"").append(str).append("\"").append(QString("}")));)
    QNetworkRequest request (destination);
    request.setHeader (QNetworkRequest::ContentTypeHeader,
    "application/x-www-formulaires-urlencoded");
    qDebug()<>
    QBuffer * buffer = new QBuffer();
    buffer-> open ((QBuffer::ReadWrite));))
    buffer-> write (jsonString.toUtf8 ());
    buffer-> seek (0);
    Manager-> sendCustomRequest (request, "PATCH", buffer);
    qDebug()<>

  • Bug with the aggregate function and no group

    When I run the following query:
    with the_table as
    (
      select 1 as id, 100 as cost from dual
      union all select 2 as id, 200 as cost from dual
      union all select 3 as id, 300 as cost from dual
      union all select 4 as id, 400 as cost from dual
      union all select 5 as id, 500 as cost from dual
    )
    select id, cost
    from
    (
      select id, cost
      from the_table
      --
      union all
      --
      select 0 as id, sum(cost) as cost
      from the_table
      where 0 = 1
      -- group by 1
    )
    order by id;
    I get this result:
    ID    COST
    --  ------
     0  <null>     
     1     100
     2     200
     3     300
     4     400
     5     500
    However, when I "uncomment" the line "Group 1", the query works as expected (without the id = rank 0).

    This occurs even when "the_table" is an array.

    Someone else comes through this (and if so, how long is a problem)?

    The database is 11.2.0.2.0 64-bit.

    EDIT: It also happens without a Union - the following returns a single line (with null 0 and cost of id) without the Group By and no line with her:
    select id, cost
    from
    (
      select 0 as id, sum(cost) as cost
      from 
      (
        select 1 as id, 100 as cost from dual
        union all select 2 as id, 200 as cost from dual
        union all select 3 as id, 300 as cost from dual
        union all select 4 as id, 400 as cost from dual
        union all select 5 as id, 500 as cost from dual
      )
      where 0 = 1
      -- group by 1
    )
    order by id
    Edited by: Donbot February 15, 2012 10:29

    Donbot wrote:
    Someone else comes through this (and if so, how long is a problem)?

    The database is 11.2.0.2.0 64-bit.

    This is a documented behavior.

    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/functions003.htm#SQLRF20035

    "
    All except COUNT (*) GROUPING and GROUPING_ID aggregate functions ignore NULL values. You can use the NVL function in the argument of an aggregation function to substitute a value for a null value. COUNTY and REGR_COUNT never return null, but return a number or zero. For all remaining functions of aggregation, * if the DataSet contains no line, * or if it contains only the rows with NULL values as arguments to the aggregate function, * then the function returns null.*
    "

  • During the closure of 2 windows (with several tabs), restore the system does restore properly the tabs in the window of the second. Is this a bug in the new update / all ideas to fix?

    I regularly use 2 windows with multiple tabs of each and session restore would work to bring them all back, but after this last updated the second window restores correctly, with the first non-visible tab on top (only in the menu drop-down) and now the button add a tab on the left (instead of right). Add a button to the tab is not really as far as concerns the other than it indicates other problems with the tabs in the 2nd window. No no not the 1st tab visible is frustrating, because I can't move or also easily navigate. Also, the tabs on the top of the 2nd window which are visible is no longer have the 'x' to close visible, except when this tab is selected. I'm assuming that it is a problem with the new version/update, since this is the first time I encountered the problem, and I closed and restored Firefox several times to make sure it was a recurring problem and not a one-time problem. Any ideas on how to fix would be welcome (except maybe cramming my tabs on a window or it suck XD).

    Thank you for your help. None of your suggested solutions worked, but having just updated to 10.0.2 seems to have solved the problem.

  • bug with the news of the spectrum

    Hello

    I have a problem with the FRF vi, which calculates the frequency response. The cluster 'info of the spectrum', the channel name is not changed when the FRF vi is looped. It seems that this problem is when the vi Polymorph selection is set to "1 stimulus, 1 reply.

    The attached vi shows my problem for a better understanding of the "bug".

    The channelname (and perhaps other properties of the spectrum) are not changed. I want to store the result of the FRF vi to a TDMS with polymorphic VI 'Write in TDMS' file available in the Toolbox for sound & Vibration. The Spectra must be registered with all of the properties and the channelname should change...

    Someone has an idea to fix this? Maybe I do not use the bandwidth as it should be, but it seems that there is a bug in the vi.

    Thanks for your help.

    Mathieu

    Hello

    I found what was wrong in my code.

    In order to have the good 'spectrum info', I put the entry "reboot on average" to true on the frequency response of vi.

    Mathieu

  • Is this a bug in the xy-Graph?

    Hi Forum,

    I came across this problem while working on this thread (http://forums.ni.com/ni/board/message?board.id=170&message.id=478607#M478607).

    I add values from 0 to 1 to a graph XY-like in the image below. (And only in this way!)

    When the user presses print a chart reference is managed by a subvi.

    In this sub - VI, there is another graph XY.

    Now, I copy all the important properties of the MainVI-XY-Graph to the Sub-VI-XY-graph.

    What is happening inside an another sub - VI, but it's not bad. The copy process may also occur within the first Subvi. Just a space saver.

    Then the Image of the Sub-VI-XY-Graph is printed via a method node.

    What I found is:

    Run the MainVI (Subvi SHOULD NOT BE OPENED)

    Change the scale of the x axis (for example, the scale of the x-axis of 0.0 to 0.1)

    Press on print

    The c:\pic.bmp file contains the chart, but the scale won't be 0-1 0.0 to 0.1!

    If you run with the Subvi is showing, it won't happen.

    And if you set the graphic content xy like this:the error does not occur.

    For those who follow me here:

    What's in my mind or IS THIS a BUG?

    Thanks for reading

    Christian

    Properties applied to hidden objects (or objects on the screens that are not open) are usually "noops" for performance reasons. If you think that I misread your description please post back.

    Ben

  • a bug with the structure that contains bit fields?

    using CVI 8.5. I tried to set up a structure that contains bit fields. Although the structure compiles, I encounter strange behavior when you access individual fields, while the value of the overall structure seems ok. Here is the structure:

    typedef struct
    {
    Union
    {
    struct
    {
    unsigned int Flag1: 1;
    unsigned int dummy: 3;
    unsigned int Flag2: 4;
    unsigned int Indicateur3: 4;
    unsigned int dummy2: 4;
    };
    unsigned short;
    } flags;
    } flagset;

    When you set the Member 'all' to a value so that one or more indicators, but not all, are false, I still read the individual like real flags, until all flags are set to false.

    I missed something? This definition is really legal?

    Please find attached a file showing the problem.

    The same issue is at stake with or without the ternary operator. It turns out the problem was not specifically with printf, but rather a bug in the compiler that is related to the evaluation of the members of anonymous internal structures. If several internal anonymous struct members are evaluated before the compiler actually do anything with the result - which is the case when passing arguments to a function-, so they will all be evaluates the value that was evaluated last.

    A. Mert

    National Instruments

  • Bug with the active State and normal state in the composition

    Hello

    I'm having a problem with the text on a composition between breakpoints. Here's an example: I the composition of new featured and I have a button with a font of 22 and then access a breakpoint and replace the police 16. The problem is that the button keeps the size of the text in the normal state on two breakpoints, but the active status changes to 16 for two breakpoints. I tried to change back the active State to a breakpoint at 22 and the other at 16, but it changes back to the last number used on the last breakpoint. Again, the normal State remains the same. Y at - it something I do or is it a bug?

    Hello Cristina,

    Please see Re: "Text on current breakpoint" button non-functional

    I would also add that the active state inherits the attributes to Normal State, so if you have your normal formatting through the breakpoints set in place as desired (for example, 22px for a breakpoint and 16px for another breakpoint), the active State will, by default, use these settings.

    If, however, you're done by explicitly change the active status value so that it ends up enforcement at all breakpoints, you can return the default by pressing the "Reset default" button in the States Panel.

    I hope this helps.

    Abhishek

  • Bug with the tag source formatting STYLE (DW CC 2015)

    The command 'Apply Source Formatting' formats incorrectly the content of the < style > tag. Instead of putting in the form and content of implementation set back as I specified in the tag library, the content and the closing tag will remain embedded to the left, for example:

    < style >

    {body

    background-color: #00005D;

    do-family: Verdana, Arial, without serif.

    }

    < / style >

    The code must be indented manually, which is having little pain, not to mention what to do so defeats the purpose of the command 'apply Source Formatting '.

    I searched the Forum of discussion here, but did not find any help for this problem.

    Is this a known bug that I'll just have to live with, or is it possible I can fix this in the configuration files?

    I think the reason for this is the default mode that CSS is formatted. When you run apply Source Formatting on an external style sheet, all selectors are flush with the left side, even within the questions from the media. The mode CSS formatting is determined by the Format of Code category in preferences (click the CSS button for advanced formatting). However, there is no option to indent the selectors.

    If you want to file a bug/feature request, use the official form: feature request/Bug Report Form

  • Mask does not move with the keyframes set

    Hello world

    Although I have been using this forum a couple of years now, I've never felt the need to ask a question, until now that is. First of all, I would like to take this opportunity to thank many of you for giving me the answers so solve my problem until I had to ask. Especially people like Bill Hunt and harm come to mind. Thank you!

    Now to my question. In my project have a key of track matte on top a video with a mask on top of it. A bit like that: '24 Kiefer Sutherland - type' edition. It worked fine for me in other projects. However, in this particular case, I set motion keyframes on the mask but it only begins to move somewhere else later key frames are defined. Pushing forward keyframes as workaround does not give a nice result. No idea what could be the problem here? I'm editting a project of 1920 x 1080 and the mask has the same dimensions. The update for first mentions something on Facebook that I don't care so I don't think a bug is removed with this upgrade and I'm afraid of updates will slow down my work flow (as was the case with the last update of Lightroom for me...)

    I hope that makes sense to any of you.

    Thanks in advance for your help.

    Kind regards

    Sébastien

    PS. If someone wants a screenshot, please explain to me how to do this, because I can't cut and paste here, it seems, and I don't know how Safe a screenshot on my hard drive (without using Powerpoint... awkward...)

    Surprise: I'm also Dutch. And it's a shame.

    But unfortunately we have English.

    You cannot adjust the video in the mask without either skew (which you did by changing the height and width) image or cropping. And the latter is your best option IMO.

    So nest the two clips with the transition.

    Draw a rectangular white in the Titler the same size when the video is supposed to go.

    The value hidden by approach the sequence embedded in the main timeline to track 2

    Add the wanted poster for track 3.

    In the nested sequence itself reduce you the video and the still picture (probably up to 50-60%) but do not uncheck the uniform scale and set the position.

    To get this just the mask on the video down and drop the opacity so you can see what you do, when done to remove or push the eyeball.

    Fact.

    Let me know if it will work for you.

Maybe you are looking for

  • network adapter missing e9150t

    My system works fine this morning - but then the network stop job.  This system is connected through a router to the ethernet adapter in the PC.  I have a second PC connected wireless through the router and it works fine. On the PC with the problem,

  • I need to reinstall Windows XP Home Edition, but I do not have the media.

    Installation of XP Home edition - w/LIP OEM Software Hello, I need help with the instalation of win XP Home edition: I have the original ticket on bottom of my laptop (> 4 years) and I would like to reinstall win xp home edition OEM software w/lip...

  • Photos are stretched on the monitor

    Photos are stretched on the monitor and look larger than they actually are.  How to make photos to display normally, they are then print?

  • Having trouble getting the correct strategy of the ESXi 5.1 Compellent Lun path selection

    Here's the FCoE connections to a Compellent table. I was looking for in fact as expected on some new 5.1 ESXi hosts. I changed the default home setting "esxcli storage set - default-psp VMW_PSP_RR - ATAS VMW_SATP_DEFAULT_AA ATAS nmp. The LUN showed 2

  • SMS message not fill

    I use the code shown in this example: http://docs.BlackBerry.com/en/developers/deliverables/11935/Create_new_populated_text_msg_565424_11... I'm trying to load a SMS message pre-filled in the Messages application, the user can then choose to modify a