Re: Finding multiple events of the same kind

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Finding multiple events of the same kind
Date: 2006-06-11 18:36:39
Message-ID: 20060611183639.19893.qmail@web31810.mail.mud.yahoo.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> On Sunday 11. June 2006 15:27, Frank Bax wrote:
> >SELECT participants.person_fk, count(participants.person_fk) FROM
> > events, participants
> >    WHERE events.event_id = participants.event_fk
> >         AND events.tag_fk in (2,62,1035)
> >    GROUP BY participants.person_fk HAVING
> > count(participants.person_fk) > 1
>
> That worked like a charm! Thank you very much!
> --

Also, you could create a unique column constraint that would prevent multiply instances of the
same person in the participants table.

Regards,

Richard Broersma Jr.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Owen Funkhouser 2006-06-11 18:38:49 remove
Previous Message Leif B. Kristensen 2006-06-11 13:34:17 Re: Finding multiple events of the same kind