Sunday, October 4, 2009

Cross Joins

Cartesian Products :
  • A Cartesian product is formed when:
    • A join condition is omitted
    • A join condition is invalid
    • All rows in the first table are joined to all rows in the second table
  • To avoid a Cartesian product, always include a valid join condition
Creating Cross Joins :
  • The CROSS JOIN clause produces the cross-product of two tables
  • This is also called a Cartesian product between the two tables
  • SELECT ename, dname FROM emp CROSS JOIN dept ;

No comments:

Post a Comment

Followers