Received: from inf1.infoserv.net (inf1.infoserv.net [200.34.71.213]) by hub.org (8.9.2/8.9.1) with ESMTP id SAA57367 for ; Fri, 29 Jan 1999 18:02:08 -0500 (EST) (envelope-from jpmarichal@infoacces.com) Received: from html ([207.249.66.254]) by inf1.infoserv.net (Post.Office MTA v3.1.2 release (PO203-101c) ID# 0-52532U15000L15000S0V35) with SMTP id AAA22803 for ; Fri, 29 Jan 1999 17:04:34 -0600 Message-ID: <199901291706480110.00297FB7@infoacces.com> In-Reply-To: References: X-Mailer: Calypso Version 2.40.41.08 Date: Fri, 29 Jan 1999 17:06:48 -0600 Reply-To: jpmarichal@infoacces.com From: jpmarichal@infoacces.com (Juan Pablo Marichal Catalan) To: pgsql-sql@postgresql.org Subject: Re: [SQL] Equivalent for an Access query Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id SAA57368 It works. Thanks a lot, Sokolowski. *********** REPLY SEPARATOR *********** On 28/01/99, at 8:31 AM, Remigiusz Sokolowski wrote: >> $result=pg_Exec($conn,"SELECT participantes.idven, >> participantes.nombreven, participantes.iding, participantes.nombreing, >> participantes.empresa, ordenes.num_ordenuf, ordenes.factura_spasp, >> ordenes.factura_vad, ordenes.fecha, ordenes.num_producto, >> productos.descripcion, ordenes.mayorista, productos.puntos, >> ordenes.cantidad, [puntos]*[cantidad] AS Total FROM productos INNER >> JOIN (participantes INNER JOIN ordenes ON idven = participante) ON >> idproducto = num_producto WHERE (((idven)="VHA1901081"))"); > >should be > >SELECT p1.idven, ......, o1.num_ordenuf, ........, p2.puntos, ....., >(p2.puntos*o1.cantidad) AS Total FROM >productos p2, ordenes o1, participantes p1 WHERE >p1.idven=o1.participante AND p1.idproducto=p2.num_producto AND >p1.idven='VHA1901081'; > >I could mistake at some fields, but syntax is ok. > Rem > >-------------------------------------------------------------------*------------ >Remigiusz Sokolowski e-mail: rems@gdansk.sprint.pl * * >-----------------------------------------------------------------*****---------- ______________________ Brotherly, JPMarichal jpmarichal@infoacces.com ICQ# 17246887