X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 491C830DEC3 for ; Fri, 20 Jun 2003 07:03:42 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 76857-03 for ; Fri, 20 Jun 2003 04:03:31 -0300 (ADT) Received: from vadangyal.vnet.hu (mail.vnet.hu [213.163.59.4]) by svr1.postgresql.org (Postfix) with ESMTP id 530BF30D1A4 for ; Fri, 20 Jun 2003 04:03:31 -0300 (ADT) Received: from compaq (adsl213172.vnet.hu [62.77.213.172]) by mail.vnet.hu (iPlanet Messaging Server 5.1 Patch 1 (built Jun 6 2002)) with ESMTPA id <0HGR006ZOQ9UDH@mail.vnet.hu> for pgsql-sql@postgresql.org; Fri, 20 Jun 2003 09:03:30 +0200 (CEST) Date: Fri, 20 Jun 2003 09:02:58 +0200 From: =?iso-8859-2?Q?Egy=FCd_Csaba?= Subject: Re: Getting one row for each subquery row...? To: Tomasz Myrta Cc: pgsql-sql@postgresql.org Reply-To: =?iso-8859-2?Q?Egy=FCd_Csaba?= Message-id: <009201c336f9$fdb9ba70$230a0a0a@compaq> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 X-Mailer: Microsoft Outlook Express 6.00.2720.3000 Content-type: text/plain; charset=iso-8859-2 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <007901c336ea$9cee0e80$230a0a0a@compaq> <3EF2A5AE.1030006@klaster.net> X-Archive-Number: 200306/234 X-Sequence-Number: 13992 Thank you Tomasz, this last one seems to be good - with a little change. select distinct t_stockchanges.productid, t_productgroups.name as pgroup from t_stockchanges join t_prod_in_pgr using (productid) join t_productgroups on (t_productgroups.id=productgroupid); Thank you again. By, -- Csaba > Sorry, if you want all combination of grups and products, you need to rewrite > your query: > > select > t_stockchanges.productid, > t_productgroups.name as pgroup > from > t_stockchanges > join t_prod_in using (productid) > join t_productgroups on (id=productgroupid) > > or something like this. > > Tomasz > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 2003. 06. 10.