Re: pgsql DATE

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: pgsql DATE
Дата
Msg-id 39070023.17BAF49@cupid.suninternet.com
обсуждение исходный текст
Ответ на pgsql DATE  ("Andras Balogh" <abalogh@grafx.ro>)
Ответы Re: pgsql DATE
Список pgsql-general
Andras Balogh wrote:
> So i am looking a date type that would allow me to do the following with one
> (or a few) query
> (and to be fast too):
> -select all records for a given month
> -select the count of records where the hour is 14.
> -select  all the records from the 7th week.
> -select count of records  where the day of the week is Sunday.
> etc.

How about you write your queries like:

date >= '01/4/2000' and date < '01/5/2000'

or equivalent. It allows use of the index but works the same.
Except for the day is Sunday though...
--
Martijn van Oosterhout <kleptog@cupid.suninternet.com>
http://cupid.suninternet.com/~kleptog/


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

Предыдущее
От: Justin Banks
Дата:
Сообщение: Re: plpgsql FOR
персональных данных