extract last months data

From: Antti Linno <alligator(at)all(dot)ee>
To: pgsql-sql(at)postgresql(dot)org
Subject: extract last months data
Date: 2000-06-28 10:04:56
Message-ID: Pine.LNX.4.04.10006281254410.9950-100000@all.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Lo.
Today I digged in manuals and other docs, but didn't find any hint, how
to get data from table, where some cols are in date or datetime format,
and the data was about last month, or about special month.
Psql help was unhelpful too.
Here's example:
In table workers is data with different date. When I need to make summary,
I just want to extract last months data, but I don't know whether the
month ended with 29,30 or 31 (external program, that uses postgres),
so I cant use
select * from workers where date<31.1.2000 and date>1.1.2000
I think I can get month and year number at least, but I can't use mday
attribute.
All suggestions are welcome :P

Stucked alligator :)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Craig 2000-06-28 10:19:14 extracting a table description
Previous Message Ben Stringer 2000-06-28 07:43:11 Selecting outside the current DB