Get interval in months - Mailing list pgsql-general

From Gerhard Heift
Subject Get interval in months
Date
Msg-id 20081108091245.GA6411@toaster.kawo1.rwth-aachen.de
Whole thread Raw
Responses Re: Get interval in months
Re: Get interval in months
List pgsql-general
Hello,

I want to get an interval in months from two dates:

SELECT '2008-02-01'::timestamp - '2008-01-01'::timestamp AS '1 month'

Here I want '1 month' and not '31 days' as answer.

How can I do this?

Regards,
  Gerhard

Attachment

pgsql-general by date:

Previous
From: Andreas Kraftl
Date:
Subject: Fulltext index
Next
From: "Asko Oja"
Date:
Subject: Re: options for launching sql script asynchronously from web app