Re: Count rows by day interval

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: Loredana Curugiu <loredana(dot)curugiu(at)gmail(dot)com>
Cc: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Count rows by day interval
Date: 2007-05-10 18:34:22
Message-ID: 248641.9937.qm@web54314.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

> ...

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 understand your problem, that should work

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Programmer 2007-05-10 19:20:10 noob trying to use PG with Zope
Previous Message Chamara Gunaratne 2007-05-10 17:54:15 Re: Disk and shared buffer cache use

Browse pgsql-sql by date

  From Date Subject
Next Message Ireneusz Pluta 2007-05-11 10:03:11 Re: insert a sequence
Previous Message ivan marchesini 2007-05-10 14:49:32 insert a sequence