Re: [GENERAL] SELECT Date

Поиск
Список
Период
Сортировка
От Evan Howarth
Тема Re: [GENERAL] SELECT Date
Дата
Msg-id AFCA1C3681746AD1@dal.intellicall.com
обсуждение исходный текст
Список pgsql-general
>I have a table with somedate defined as date.
>
>I want to select all rows that are from todays date back to 7 days
>ago. Or in this case 10-1-1998.

Use the function age() somewhat like this:

select * from sometable
where date_part( 'epoch' , age( 'now', somedate ) ) > 604800

The 'epoch' date part is the total number of seconds between the two dates.
For other variations, see:

http://www/postgresql.org/docs/user/functions1574.htm

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

Предыдущее
От: Anand Surelia
Дата:
Сообщение: Re: [GENERAL] Row Nums
Следующее
От: "Taral"
Дата:
Сообщение: select * from table where oid = number;