Re: finding firstname + lastname groups

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: finding firstname + lastname groups
Date: 2008-06-19 21:14:45
Message-ID: 20080619211445.GP2572@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 19, 2008 at 03:38:28PM -0400, blackwater dev wrote:
> The problem is name is not one column but made up of firstname,
> lastname...how do I do this?

I'd probably do something like:

SELECT firstname, lastname, COUNT(*)
FROM people
GROUP BY firstname, lastname
HAVING COUNT(*) > 1;

Sam

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2008-06-19 22:15:06 Re: Losing data
Previous Message David Wilson 2008-06-19 20:47:42 Re: renumber table