Skip site navigation (1) Skip section navigation (2)

Re: compare month[modified]

From: george young <gry(at)ll(dot)mit(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: compare month[modified]
Date: 2006-04-04 15:22:24
Message-ID: 20060404112224.6037ccff.gry@ll.mit.edu (view raw or flat)
Thread:
Lists: pgsql-novice
On Tue, 4 Apr 2006 00:05:49 -0700 (PDT)
shakil tanvir <tanvirshakil(at)yahoo(dot)com> threw this fish to the penguins:

> Hi all of you PostGreSQL fans,
> 
> I need to run a query like
> 
> SELECT users from userlog where lastlogindate is less than one month of current date
> or 
> SELECT users from userlog where lastlogindate is less than 15 days of current date

The "age" builtin function is handy in these circumstances:

  select users from userlog where age(lastlogindate) < '1 month';


> Can any one help with sql example?
> 
> Shakil
> tanvirshakil(at)yahoo(dot)com
> 
> 		
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.


-- 
"Are the gods not just?"  "Oh no, child.
What would become of us if they were?" (CSL)

In response to

pgsql-novice by date

Next:From: innerDate: 2006-04-04 16:44:36
Subject: Re: BYTEA: insert query max size
Previous:From: Tom LaneDate: 2006-04-04 13:43:03
Subject: Re: BYTEA: insert query max size

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group