Re: compare month

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: compare month
Дата
Msg-id 9E27CE9E-BBA0-42C2-85BC-C795A13E41F2@myrealbox.com
обсуждение исходный текст
Ответ на compare month  (shakil tanvir <tanvirshakil@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: compare month
Следующее
От: Kaloyan Iliev
Дата:
Сообщение: Re: compare month