[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

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

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 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

[SQL] remove

2006-06-11 Thread Owen Funkhouser
---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

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

[SQL] COPY to table with array columns (Longish)

2006-06-11 Thread Phillip Smith
Hi All,   Hope someone can help me – our main company system runs on Raining Data PICK/D3 (if anyone familiar with it) which stores records in it’s “tables” as variable length items. Every item has a unique Primary Key (per table) then each item can have a variable number of fields. These