grouping with CUBE on DUAL doesn't work

Ivan C.

Member³
Greetings!

I guess you have some sort of "local" implementation for queries against the DUAL table, because I'm getting different result than in SQL*Plus.

PL/SQL Developer:

Code:
SQL> select 1 from dual;

         1
----------
         1

SQL> select 1 from dual group by cube (1);

         1
----------
         1
         1

SQL> select 1 from dual group by cube (1, 2);

         1
----------
         1
         1
         1
         1
SQL*Plus:

Code:
SQL> select 1 from dual;

         1
----------
         1

SQL> select 1 from dual group by cube (1);

         1
----------
         1

SQL> select 1 from dual group by cube (1, 2);

         1
----------
         1
Could you please fix it?

Thank you beforehand.
Ivan C.
 
There is no local implementation. The query is sent to the server, and the results are displayed. I guess that SQL*PLus does something with this result set, because if you run the following query it clearly says "4" (both in SQL*Plus and PL/SQL Developer):

Code:
SQL> select count(*) from
  2    (select 1 from dual group by cube (1, 2));

  COUNT(*)
----------
         4

SQL>
 
Back
Top