Re: subtract two dates to get the number of days

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: subtract two dates to get the number of days
Дата
Msg-id i1hvb8$58a$1@dough.gmane.org
обсуждение исходный текст
Ответ на subtract two dates to get the number of days  ("Campbell, Lance" <lance@illinois.edu>)
Список pgsql-sql
Campbell, Lance, 13.07.2010 16:58:
> I want to subtract to dates to know the number of days different.
>
> Example:
>
> 01/02/2010 - 01/01/2010 = 1 day
>
> 08/01/2010 - 07/31/2010 = 1 day
>
> How do I do this?

SELECT DATE '2010-02-01' - DATE '2010-01-01';

SELECT DATE '2010-08-01' - DATE '2010-07-31';







В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: subtract two dates to get the number of days
Следующее
От: silly sad
Дата:
Сообщение: Re: subtract two dates to get the number of days