Re: [SQL] Count rows by day interval

2007-05-10 Thread chester c young
> ... instead of date_trunc('day',sent_messages.date) why don't you have a function that takes four three arguments: - beginning date of query - interval, ie, reminder_services.activity_days_min - timestamp, ie, sent_messages.date have it return the minimum date for that interval as I think I u

[SQL] insert a sequence

2007-05-10 Thread ivan marchesini
Dear postgres Users, I have a simple question I think. I have a table that contains some columns one of these columns (the columns ID) contains distinct integer values ... I need to insert into this table some other records but I only need that values were inserted into the ID column and that they

Re: [SQL] query to select a linked list

2007-05-10 Thread Louis-David Mitterrand
On Thu, May 10, 2007 at 09:49:32AM +1000, Robert Edwards wrote: > > Hi Louis-David, > > I also have written a forum application using PostgreSQL. > > My schema has a "threadid" for each posting, which is actually also the > "messageid" of the first posting in the thread, but that is irrelevant.

[SQL] Count rows by day interval

2007-05-10 Thread Loredana Curugiu
Dear all, I have the following 3 tables: TABLE 1: themes uid | theme -+ 1 | HOME 2 | BILL 3 | ERROR 4 | ACTION 5 | ANA 6 | LIA 7 | MIA TABLE 2: reminder_services uid | theme_uid | activity_min_days | activity_max_months -++