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 3C6FDD1B52D for ; Sat, 8 Nov 2003 07:44:36 +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 98399-06 for ; Sat, 8 Nov 2003 03:44:05 -0400 (AST) Received: from web14604.mail.yahoo.com (web14604.mail.yahoo.com [216.136.224.84]) by svr1.postgresql.org (Postfix) with SMTP id 19306D1B506 for ; Sat, 8 Nov 2003 03:44:04 -0400 (AST) Message-ID: <20031108074404.14151.qmail@web14604.mail.yahoo.com> Received: from [202.133.205.50] by web14604.mail.yahoo.com via HTTP; Sat, 08 Nov 2003 07:44:04 GMT Date: Sat, 8 Nov 2003 07:44:04 +0000 (GMT) From: =?iso-8859-1?q?ron=5Ftabada?= Reply-To: ronald@my.msuiit.edu.ph Subject: query problem To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-605848159-1068277444=:11174" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=HTML_10_20 X-Spam-Level: * X-Archive-Number: 200311/46 X-Sequence-Number: 15861 --0-605848159-1068277444=:11174 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello everyone, Good day! Could anyone help me translate this query in Microsoft 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 = supplieditems.itemno GROUP BY items.description; Query2: SELECT [items].[description], Sum([customer].[qty]) AS SumOfqty FROM (items INNER JOIN OtherItem ON [items].[itemno]=[OtherItem].[Itemno]) INNER JOIN customer ON [OtherItem].[Itemno]=[customer].[itemcode] GROUP BY [items].[description]; Query3: SELECT [Query1].[SumOfqty], [Query2].[SumOfqty], [Query1]![SumOfqty]-[Query2]![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? Get the FREE Yahoo!Messenger --0-605848159-1068277444=:11174 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hello everyone, Good day! Could anyone help me translate this query in Microsoft 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 = supplieditems.itemno
GROUP BY items.description;
Query2:
SELECT [items].[description], Sum([customer].[qty]) AS SumOfqty
FROM (items INNER JOIN OtherItem ON [items].[itemno]=[OtherItem].[Itemno]) INNER JOIN customer ON [OtherItem].[Itemno]=[customer].[itemcode]
GROUP BY [items].[description];
Query3:
SELECT [Query1].[SumOfqty], [Query2].[SumOfqty], [Query1]![SumOfqty]-[Query2]![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? Get the FREE Yahoo! Messenger --0-605848159-1068277444=:11174--