Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 03D15475931 for ; Wed, 29 May 2002 08:17:06 -0400 (EDT) Received: from mps3.plala.or.jp (mpsb-nat18.plala.or.jp [202.212.115.65]) by postgresql.org (Postfix) with ESMTP id 93596475910 for ; Wed, 29 May 2002 08:17:00 -0400 (EDT) Received: from vip1600 ([218.47.117.179]) by mps3.plala.or.jp with ESMTP id <20020529121702.YEZO9425.mps3.plala.or.jp@vip1600>; Wed, 29 May 2002 21:17:02 +0900 Date: Wed, 29 May 2002 21:17:26 +0900 From: Masaru Sugawara To: "Denilson Guedes Duarte" Subject: Re: Problems in query Cc: pgsql-admin@postgresql.org In-Reply-To: <001701c203eb$31173e80$0a01010a@bnet.com.br> References: <001701c203eb$31173e80$0a01010a@bnet.com.br> Message-Id: <20020529204154.7872.RK73@sea.plala.or.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.00.11 X-Archive-Number: 200205/245 X-Sequence-Number: 4420 On Sat, 25 May 2002 09:53:39 -0300 "Denilson Guedes Duarte" wrote: > and runs ok, but the problem is that the table username (alias u) hane N records and I want to get only one record. I try to use a subqyuery: > select .... > (select u.username from ctareceber c left join username u on u.id=c.cod_cliente limit 1) as fldusername > ..... > in this case the query run ok, but I lose the left join property. > > How I can to do run with left join and get only one record in the other table (username u) ? > I'm not sure what the problems is. Could you show us the output of the result you hope ? Regards, Masaru Sugawara