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 8E4E3D1B507 for ; Fri, 14 Nov 2003 01:05:29 +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 67290-10 for ; Thu, 13 Nov 2003 21:05:01 -0400 (AST) Received: from filter.mimos.my (filter.mimos.my [192.228.137.70]) by svr1.postgresql.org (Postfix) with ESMTP id C2509D1B55A for ; Thu, 13 Nov 2003 21:04:56 -0400 (AST) Received: from ew.mimos.my (localhost.localdomain [127.0.0.1]) by filter.mimos.my (8.11.6/8.11.6) with ESMTP id hAE14vE07052 for ; Fri, 14 Nov 2003 09:04:58 +0800 Received: (from root@localhost) by ew.mimos.my (8.12.8p2/8.12.3) id hAE14vOT094907 for pgsql-sql@postgresql.org; Fri, 14 Nov 2003 09:04:57 +0800 (MYT) (envelope-from wahab@mimos.my) Received: from mimos.my (sol-wel197.nat.mimos.my [10.1.23.197]) by ew.mimos.my (8.12.8p2/8.11.6) with ESMTP id hAE14u5f094568 for ; Fri, 14 Nov 2003 09:04:57 +0800 (MYT) (envelope-from wahab@mimos.my) Message-ID: <3FB42A2F.20801@mimos.my> Date: Fri, 14 Nov 2003 09:04:47 +0800 From: Abdul Wahab Dahalan User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Need Help X-scanner: scanned by Inflex 1.0.10 - (http://pldaniels.com/inflex/) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/162 X-Sequence-Number: 15977 Hi! If I've a table like this kk kj pngk vote 01 02 a 12 01 02 b 10 01 03 c 5 and I want to have a query so that it give me a result as below. The condition is for each record with the same kk and kj but difference pngk will be give a mark *; [In this example for record 1 and record 2 we have same kk=01 and kj=02 but difference pngk a and b so we give * for the mark] kk kj pngk vote mark 01 02 a 12 * 01 02 b 10 * 01 03 c 5 How should I write the query? Thanks in advanced.