-
Why does this happen ?
SQL> SELECT 1,2,3 FROM DUAL
2 GROUP BY CUBE(1,2,3);
1 2 3
---------- ---------- ----------
1 2 3
SQL> SELECT * FROM
2 (SELECT 1,2,3 FROM DUAL
3 GROUP BY CUBE(1,2,3)
4 );
1 2 3
---------- ---------- ----------
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
8 ROWS SELECTED
-
If you use SQL*PLus, try another tool like TOAD. If you create another table with one record and use this table instead of dual, you get in the first select also 8 rows.
In SQL*Plus a select from dual always returns one row. I think it is for optimization, but you can get unexpected (or wrong) results.
[Edited by akkerend on 04-18-2001 at 03:44 PM]