pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Lockhart <lockhart@alumni.caltech.edu>
To: Antti Linno <alligator@all.ee>
Cc: pgsql-sql@postgresql.org
Subject: Re: extract last months data
Date: Wed, 28 Jun 2000 14:12:34 +0000
Message-ID: <395A07D2.9947951F@alumni.caltech.edu> (raw)
References: <Pine.LNX.4.04.10006281254410.9950-100000@all.ee>

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

  select * from t1
    where d >= (date_trunc('month', timestamp 'today')
        - interval '1 month')
      and d < date_trunc('month', timestamp 'today');

                    - Thomas



view thread (3+ messages)

Message-ID: <395A07D2.9947951F@alumni.caltech.edu>
Permalink:  ../395A07D2.9947951F@alumni.caltech.edu/
Also on:    postgresql.org/message-id/395A07D2.9947951F@alumni.caltech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: lockhart@alumni.caltech.edu, alligator@all.ee
  Subject: Re: extract last months data
  In-Reply-To: <395A07D2.9947951F@alumni.caltech.edu>
  References: <Pine.LNX.4.04.10006281254410.9950-100000@all.ee> <395A07D2.9947951F@alumni.caltech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox