DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: sql

  1. #1
    Join Date
    May 2000
    Posts
    58
    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

  2. #2
    Join Date
    Jul 2000
    Posts
    296
    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width