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 89A43D1D803 for ; Wed, 19 Nov 2003 10:35:22 +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 42109-08 for ; Wed, 19 Nov 2003 06:34:53 -0400 (AST) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by svr1.postgresql.org (Postfix) with ESMTP id B9D3BD1D5CF for ; Wed, 19 Nov 2003 06:34:50 -0400 (AST) Received: from myrealbox.com glaesema@smtp-send.myrealbox.com [61.115.206.98] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.44 $ on Novell NetWare; Wed, 19 Nov 2003 03:34:52 -0700 Date: Wed, 19 Nov 2003 19:34:45 +0900 Subject: Re: Need Help : Query problem Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: pgsql-sql@postgresql.org To: Abdul Wahab Dahalan From: Michael Glaesemann In-Reply-To: <3FBAC6AA.80404@mimos.my> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/235 X-Sequence-Number: 16050 On Wednesday, November 19, 2003, at 10:26 AM, Abdul Wahab Dahalan wrote: > > How do I write a query so that I can get a result as below > [ select only a record/s with same kk and kj but different pngk. > For example here I've 3 records with same kk=01,kj=01 but diff > pngk=a,b,c > and 2 records with same kk=01,kj=02 but diff pngk=a,b] I think you'll want to take a look at using GROUP BY