Re: sql query

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 30 Aug 2000 12:58:36 +0200
Message-ID: <kmppqsgo0sg4sg6j6c3l9ilsa58g3qr7j7_at_4ax.com>


On Wed, 30 Aug 2000 04:17:44 -0700, Sandy <daleelaNOdaSPAM_at_usa.net.invalid> wrote:

>hi,
>
>Is there a problem in a query when you do something like
>this :
>
>select * from toto, baba where toto='2';
>
>the table baba is not used . Does it cause a pb ??
>Cuz for me instead of giving me one line it gives me two.
>
>thanks
>sandy
>
>
>
>* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful

[Quoted] As you have no join condition between toto and baba, you'll get a cartesian product automatically. Suppose n records will satisfy the criterion on toto and m records on baba (you definitely use that table, contrary to what you think!), you'll get n times m records back.
This means your query is incorrect and you either need to remove baba or provide a proper join condition between toto and baba. Sorry to say so, but your question is *very* elementarily. You may profit from buying the sql guide to Oracle by Rick van der Lans http://www.amazon.com/exec/obidos/ASIN/0201565455

This teaches everything from ground up, it has been around for 14 years, you can't go wrong with this one.

Regards,

Sybrand Bakker, Oracle DBA Received on Wed Aug 30 2000 - 12:58:36 CEST

Original text of this message