pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Glaesemann <grzm@myrealbox.com>
To: Abdul Wahab Dahalan <wahab@mimos.my>
Cc: pgsql-sql@postgresql.org
Subject: Re: Need Help : Query problem
Date: Wed, 19 Nov 2003 19:34:45 +0900
Message-ID: <FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com> (raw)
In-Reply-To: <3FBAC6AA.80404@mimos.my>


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

<http://www.postgresql.org/docs/7.4/static/queries-table- 
expressions.html#queries-group>





view thread (2+ messages)

Message-ID: <FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com>
Permalink:  ../FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com/
Also on:    postgresql.org/message-id/FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: grzm@myrealbox.com, wahab@mimos.my
  Subject: Re: Need Help : Query problem
  In-Reply-To: <FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com>
  References: <3FBAC6AA.80404@mimos.my> <FE37527E-1A7B-11D8-B800-0005029FC1A7@myrealbox.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox