dbTalk Databases Forums  

Cartesian Product

comp.databases.olap comp.databases.olap


Discuss Cartesian Product in the comp.databases.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nitin
 
Posts: n/a

Default Cartesian Product - 08-09-2006 , 11:04 AM






I was wondering Like if we have two tables with regular join, what
would be the cartesian product of the two tables. What does a cartesian
poduct mean here.
Thanks
Nitin


Reply With Quote
  #2  
Old   
Richard Nixon
 
Posts: n/a

Default Re: Cartesian Product - 08-19-2006 , 09:29 PM






If you join with a WHERE clause, then you wouldn't have a cartesian
product. If you join without a WHERE clause,

SELECT A.*, B.* FROM A, B

from a table A with M rows and a table B with N rows then you'll get a
cartesian product, a set of M x N records consisting of

A1-B1: all fields from record 1 of table A and record 1 of table B
A1-B2: all fields from record 1 of table A and record 2 of table B
....
A1-BN: all fields from record 1 of table A and record N of table B
A2-B1: all fields from record 2 of table A and record 1 of table B
A2-B2: all fields from record 2 of table A and record 2 of table B
....
A2-BN: all fields from record 2 of table A and record N of table B
....
AM-B1: all fields from record M of table A and record 1 of table B
AM-B2: all fields from record M of table A and record 2 of table B
....
AM-BN: all fields from record M of table A and record N of table B

Seth


Nitin wrote:
Quote:
I was wondering Like if we have two tables with regular join, what
would be the cartesian product of the two tables. What does a cartesian
poduct mean here.
Thanks
Nitin


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.