Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: ANSI Joins: CROSS JOIN Jump to:  
Category: >> Oracle PL/SQL >> ANSI Joins: CROSS JOIN Bookmark and Share

<< lastnext >>

Snippet Name: ANSI Joins: CROSS JOIN

Description: Example of an ANSI-style CROSS JOIN.

Also see:
» INDEXES: Bitmap Join Indexes
» ANSI Joins: FULL JOIN
» ANSI Joins: OUTER JOIN
» ANSI Joins: CROSS JOIN
» ANSI Joins: INNER JOIN
» Self-join example and syntax
» FULL JOIN example and syntax
» RIGHT JOIN example and syntax
» LEFT JOIN example and syntax
» INNER JOIN example and syntax
» WHERE Clause - Joins
» Dates: Oddball Stuff
» Date Functions: WHERE Clause Joins

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 10th, 2009

CREATE TABLE table_one (
  col_one NUMBER,
  col_two VARCHAR2(10)
);
 
CREATE TABLE table_two (
  col_three NUMBER,
  col_four  VARCHAR2(10)
);
 
INSERT INTO table_one VALUES ( 1,    'one');
INSERT INTO table_one VALUES ( 2,    'two');
 
INSERT INTO table_two VALUES (10,    'ten');
INSERT INTO table_two VALUES (20, 'twenty');
INSERT INTO table_two VALUES ( 5,   'five');
 
SELECT * FROM
  table_one cross join
  table_two;
 
 
-- Each row from table_one is returned together 
-- with each row from table_two:
 
   COL_ONE COL_TWO     COL_THREE COL_FOUR
---------- ---------- ---------- ----------
         1 one                10 ten
         1 one                20 twenty
         1 one                 5 five
         2 two                10 ten
         2 two                20 twenty
         2 two                 5 five
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 81 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?