Re: compare month - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: compare month
Date
Msg-id 9E27CE9E-BBA0-42C2-85BC-C795A13E41F2@myrealbox.com
Whole thread Raw
In response to compare month  (shakil tanvir <tanvirshakil@yahoo.com>)
List pgsql-novice
Hi!

On Apr 4, 2006, at 15:58 , shakil tanvir wrote:

> Hi all of you PostGreSQL fans,

True fans spell it PostgreSQL :)

> SELECT users from userlog where lastlogindate is less than one month
> or

select users
from userlog
where lastlogindate > current_timestamp - 1 * interval '1 month';


> SELECT users from userlog where lastlogindate is less than 15 days

select users
from userlog
where lastlogindate > current_timestamp - 15 * interval '1 day';

You can also use current_date instead of current_timestamp, depending
on your desired data type.

Hope this helps!

Michael Glaesemann
grzm myrealbox com




pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: compare month
Next
From: Kaloyan Iliev
Date:
Subject: Re: compare month