Re: [SQL] Finding multiple events of the same kind

2006-06-13 Thread Leif B. Kristensen
My question and your answer have now become part of a blog entry at my site: . Thank you again. -- Leif Biberg Kristensen | Registered Linux User #338009 http://solumslekt.org/ | Cruising with Gentoo/KDE ---(end of broadcast)--

Re: [SQL] Finding multiple events of the same kind

2006-06-11 Thread Leif B. Kristensen
On Sunday 11. June 2006 20:36, Richard Broersma Jr wrote: >Also, you could create a unique column constraint that would prevent > multiply instances of the same person in the participants table. I have considered that as well. But as my front end main view looks like a "structured document" in a

Re: [SQL] Finding multiple events of the same kind

2006-06-11 Thread Richard Broersma Jr
> 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(p

Re: [SQL] Finding multiple events of the same kind

2006-06-11 Thread Leif B. Kristensen
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.pe

Re: [SQL] Finding multiple events of the same kind

2006-06-11 Thread Frank Bax
At 08:53 AM 6/11/06, Leif B. Kristensen wrote: I've got two tables: CREATE TABLE events ( event_idINTEGER PRIMARY KEY, tag_fk INTEGER NOT NULL REFERENCES tags (tag_id), place_fkINTEGER NOT NULL REFERENCES places (place_id), event_date CHAR(18) NOT NULL DEFAULT '000

[SQL] Finding multiple events of the same kind

2006-06-11 Thread Leif B. Kristensen
I've got two tables: CREATE TABLE events ( event_idINTEGER PRIMARY KEY, tag_fk INTEGER NOT NULL REFERENCES tags (tag_id), place_fkINTEGER NOT NULL REFERENCES places (place_id), event_date CHAR(18) NOT NULL DEFAULT '31', sort_date DATE NOT NULL DE