Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cartesian Joins

Re: Cartesian Joins

From: Martin Doherty <martin.doherty_at_oracle.com>
Date: Mon, 16 Sep 2002 16:18:15 -0700
Message-ID: <3D8666B6.1B7816DD@oracle.com>


Partial cartesian joins can be quite useful, for example to produce the correct number of names and addresses for a mailing label run (e.g. from Oracle Reports)

Have a table 'CARTESIAN' like this:
CARDINALITY



1
2
3
etc

and another table 'CUSTOMER' like this:
NAME, ADDRESS Then,
select cust.name, cust.address
from customer cust, cartesian cart
where cart.cardinality <= 2

This will generate 2 labels per customer. If the customer table has a column called label_quantity, then a variable # of labels can be produced per customer.

I have also found cartesian joins useful when I want to produce large result data sets from small amounts of input data (for volume testing).

Martin Doherty

Bob McAlone wrote:

> Can anyone come up with a scenario where a cartesian join is good? A lot of
> the manuals say that is is _probably_ an error / bad design which implies
> that it does have a use. Every case me and the guys at work come up with can
> be better solved with a half decent normalised design.
>
> Cheers
> Bob


Received on Mon Sep 16 2002 - 18:18:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US