November 13th, 2003, 11:18 AM
fetching records with date range
I have to fetch records from a table where the date difference is one year. My table structure looks like this:
review_time timestamp with time zone,
I need to get records for a specific reviewerid where review_time is one year. In other words,
I need to check how many proposals a reviewer has reviewed in one year duration.
any hint or help will be appreciated
November 13th, 2003, 11:35 AM
Re: fetching records with date range
SELECT reviewerid, count(revierwerid) FROM tablename WHERE review_time >= NOW() - '1 year'::interval GROUP BY reviewerid .
This is untested, but I believe it should give what you want - how many reviews a particular reviewer had over the last year.
Comments on this post
PostgreSQL, it's what's for dinner...
November 13th, 2003, 02:44 PM
Thank you very much. This is what I wanted. I appreciate your help.