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: How does SELECT work?

Re: How does SELECT work?

From: tojo <TomJordanTojo_at_hotmail.com>
Date: Mon, 8 Jul 2002 11:45:15 +0200
Message-ID: <MPG.17937d97d89e276a98969c@news.t-online.de>


In article <agbm25$omp$1_at_news.gu.se>, konrad_at_voxway.com says...
> Say that we have two tables COFFEES and SUPPLIERS
> (yes, from Suns site). When i execute this:
>
> "Select * COFFEES, SUPPLIERS"
>
> and print the results (only one column - Cof_Name) i get
> all the names of coffees (which i expected) BUT three
> times!
>
> As there are three rows in SUPPLIERS i start to suspect
> that the command above gives me result of EVERY row in
> table 1 FOR EVERY row in table 2.
>
> The question: Have i done something stupid or is my suspicion
> correct?
>
> --

If you don't join the tables in some way, you will get a cartesian product. That means every row in COFFEES for every row in SUPPLIERS - not very meaningful. See the SQL Reference chapter 5 about joins.

Received on Mon Jul 08 2002 - 04:45:15 CDT

Original text of this message

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