X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 58974D1B51E for ; Sun, 9 Nov 2003 20:54:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49611-07 for ; Sun, 9 Nov 2003 16:54:02 -0400 (AST) Received: from heineken.cs.stevens-tech.edu (heineken.cs.stevens-tech.edu [155.246.89.69]) by svr1.postgresql.org (Postfix) with ESMTP id 5B5D1D1B4EF for ; Sun, 9 Nov 2003 16:54:00 -0400 (AST) Received: from ymalik (helo=localhost) by heineken.cs.stevens-tech.edu with local-esmtp (Exim 3.35 #1 (Debian)) id 1AIwYx-0001P3-00; Sun, 09 Nov 2003 15:53:35 -0500 Date: Sun, 9 Nov 2003 15:53:35 -0500 (EST) From: Yasir Malik To: ronald@my.msuiit.edu.ph Cc: pgsql-sql@postgresql.org Subject: Re: help me... In-Reply-To: <20031108060215.7557.qmail@web14605.mail.yahoo.com> Message-ID: References: <20031108060215.7557.qmail@web14605.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/92 X-Sequence-Number: 15907 Hi, I'm usually wrong, but you can create a view for Query1 and Query2. That is do create view Query1 [your query for query1]; create view Query2 [your query for query2]; Then what you are doing should work. Regards, Yasir On Sat, 8 Nov 2003, [iso-8859-1] ron_tabada wrote: > Date: Sat, 8 Nov 2003 06:02:15 +0000 (GMT) > From: "[iso-8859-1] ron_tabada" > Reply-To: ronald@my.msuiit.edu.ph > To: pgsql-sql@postgresql.org > Subject: [SQL] help me... > > Hello everyone, Good day! Could anyone help me translate this query in Mi= crosoft Access to Postgresql. I'm having a difficulty. Pls... > Query1: > SELECT items.description, Sum(supplieditems.qty) AS SumOfqty > FROM items INNER JOIN supplieditems ON items.itemno =3D supplieditems.ite= mno > GROUP BY items.description; > Query2: > SELECT [items].[description], Sum([customer].[qty]) AS SumOfqty > FROM (items INNER JOIN OtherItem ON [items].[itemno]=3D[OtherItem].[Itemn= o]) INNER JOIN customer ON [OtherItem].[Itemno]=3D[customer].[itemcode] > GROUP BY [items].[description]; > Query3: > SELECT [Query1].[SumOfqty], [Query2].[SumOfqty], [Query1]![SumOfqty]-[Que= ry2]![SumOfqty] AS remain > FROM Query1, Query2; > I have translated Query1 and Query2 in POSTGRESQL but I don't know how to= implement Query3. > > > --------------------------------- > Want to chat instantly with your online friends?=A0Get the FREE Yahoo!Mes= senger