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 |