pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chad Thompson <chad@weblinkservices.com>
To: Aaron Chu <astrate@mac.com>
To: pgsql-sql@postgresql.org
Subject: Re: Beginner needs help
Date: Sat, 1 Mar 2003 15:55:57 -0700
Message-ID: <094f01c2e045$b9ff5980$32021aac@chad> (raw)
References: <96853212-4AA9-11D7-8F7C-000393017462@mac.com>

So, if I understand.  You want a list of people whose surnames appear more
than once?

Something like

select count(*), surname
from mytable
group by surname
having count(*) > 1

This will show a unique list of all the surnames that appear more than 1
time.

HTH
Chad
----- Original Message -----
From: "Aaron Chu" <astrate@mac.com>
To: <pgsql-sql@postgresql.org>
Sent: Thursday, February 27, 2003 4:17 PM
Subject: [SQL] Beginner needs help


> Hi,
>
> I have a table which has a column of surnames (string) and I would like
> to know how can I retrieve (SELECT) all the repeated surnames, i.e.
> more than one person who has the same surname.
>
> Thanks.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>




view thread (9+ messages)  latest in thread

Message-ID: <094f01c2e045$b9ff5980$32021aac@chad>
Permalink:  ../094f01c2e045$b9ff5980$32021aac@chad/
Also on:    postgresql.org/message-id/094f01c2e045$b9ff5980$32021aac@chad

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chad@weblinkservices.com, astrate@mac.com
  Subject: Re: Beginner needs help
  In-Reply-To: <094f01c2e045$b9ff5980$32021aac@chad>

* 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