Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cartesian Joins
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
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
![]() |
![]() |