🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #10954

Re: JOINING 3 TABLES

#10954
From: Bill Todd
Date: Mon, 30 Dec 2002 21:40
52 lines
2352 bytes

On Mon, 30 Dec 2002 17:47:04 -0300, "Sergio Gonzalez" <shg@sion.com>
wrote:

>Hi there!
>I need to join 3 tables.
>Does this SELECT makes any cense? It don't work anyway!

It makes sense if what you want is all of the rows from oc that have
matching rows in both des and ar and that have the specified oc.numero
and des.id_tip_des.

"It don't work" does not tell us very much. You need to provide a much
more detailed explanation of your problem if you want help.

>
>select
>   oc.*,
>   des.NOMBRE,
>   ar.CODIGO, ar.CODIGO_BARON,  ar.CODIGO_S_PROV
>from
>   ORDEN_COMPRA_1 oc,
>   DESCRIPCIONES des,
>   ARTICULO ar
>where
>   oc.NUMERO = :NUMERO  and
>   oc.ID_ARTICULO = des.ID and
>   oc.ID_ARTICULO = ar.ID   and
>   des.ID_TIPO_DES = :ID_TIPO_DES
>
>DESCRIPTION OF THE TABLES:
>
>ORDEN_COMPRA_1 = Items of purchase orders (it is the detail table of the
>main purchase orders table)
>DESCRIPCIONES = It has different kind of descriptions for each item in the
>items table
>ARTICULO = Items table
>
>The parameter :NUMERO is passed from the master table.
>I'm not sure if the parameter :ID_TIPO_DES its being passed automatically
>from the master table also.
>(it has a field named ID_TIPO_DES)
>
>Many Thanks!
>
>


--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Technical Details
Message-ID: <27f11v8svcl7nf4u3v6ja8fvrmshonp1tn@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e10b17c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,287ab2d1cf2e4217
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-30 13:53:30 PST
From: Bill Todd <bill@notthis.dbginc.com>
Newsgroups: borland.public.interbase.sql
Subject: Re: JOINING 3 TABLES
Date: Mon, 30 Dec 2002 14:40:39 -0700
Message-ID: <27f11v8svcl7nf4u3v6ja8fvrmshonp1tn@4ax.com>
References: <3e10b17c@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 216.207.211.50
X-Trace: newsgroups.borland.com 1041284440 216.207.211.50 (30 Dec 2002 13:40:40 -0800)
Lines: 52
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail