X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CCDCDD93AF for ; Mon, 10 Oct 2005 10:37:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51688-04 for ; Mon, 10 Oct 2005 13:37:30 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 13BDDD8C85 for ; Mon, 10 Oct 2005 10:37:31 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9ADbULU081945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Oct 2005 07:37:33 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j9ADbUio098415; Mon, 10 Oct 2005 07:37:30 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j9ADbUX4098414; Mon, 10 Oct 2005 07:37:30 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 10 Oct 2005 07:37:30 -0600 From: Michael Fuhr To: "M. Imran" Cc: pgsql-admin@postgresql.org Subject: Re: Query Question Message-ID: <20051010133730.GA98353@winnie.fuhr.org> References: <01c201c5cd84$4a2568f0$b901a8c0@sdp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01c201c5cd84$4a2568f0$b901a8c0@sdp.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/113 X-Sequence-Number: 19185 On Mon, Oct 10, 2005 at 03:20:47PM +0500, M. Imran wrote: > I want to select distinct CODE and thier respective sex, sex can > be male/female, can I get my result strictly distinct in code. > Currently it duplicate code value for each male and female. I am > using this query > > select distinct(code), id from table It's not clear what you're trying to do. Could you post a sample table and data set (CREATE TABLE and INSERT statements) and an example of the results you'd like to see? BTW, this seems off-topic for pgsql-admin, which is supposed to be for discussions of PostgreSQL administration. A more appropriate list might be pgsql-general, pgsql-novice, or pgsql-sql. -- Michael Fuhr