Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create table of fake data from dual?

Rodney ChanOct 2 2011 — edited Oct 4 2011
I was just curious, would it be possible to generate a fake "table" of lets say, two rows from the table DUAL?

For example I could do this
SELECT '1' PRIM, 'CHILLY' COL2, 'ANIMAL' ANIMAL_TYPE
FROM DUAL;
Which would give me a row table of
PRIM     COL2   ANIMAL_TYPE 
----       ------       ----------- 
1         CHILLY  ANIMAL     
I was wondering how could i do something similar but have more then 1 row such as
PRIM     COL2     ANIMAL_TYPE 
----       ------       ----------- 
1         CHILLY    ANIMAL 
2         FUDGE    ANIMAL
I know another way is i could write something like this
SELECT 'John Doe', '555-1212' FROM DUAL
UNION ALL
SELECT 'Peter Doe','555-2323' FROM DUAL
But was looking for something more "efficient" possibly to generate like lets say 10 rows

Thanks

Edited by: rodneyc8063 on Oct 2, 2011 6:12 PM
This post has been answered by Frank Kulash on Oct 2 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2011
Added on Oct 2 2011
6 comments
6,987 views