Re: date ranges in where

Поиск
Список
Период
Сортировка
От Erik Jones
Тема Re: date ranges in where
Дата
Msg-id B85DD776-D78A-4907-976B-682A5D0A658D@engineyard.com
обсуждение исходный текст
Ответ на Re: date ranges in where  (Adrian Klaver <aklaver@comcast.net>)
Ответы Re: date ranges in where  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
On May 6, 2009, at 2:19 PM, Adrian Klaver wrote:

> On Wednesday 06 May 2009 2:12:47 pm Miguel Miranda wrote:
>> Hi, what is the recommended way to select a range of dates?
>>
>> Lets say a have a table with a lastlogin (timestamp) column and i
>> want
>> toknow what users logged in for last time between 2009-05-01 and
>> 2009-05-02?
>>
>> I know that a simple
>>
>> where lastlogin between '2009-05-01' and '2009-05-02' doesnt work
>> beacuse
>> it doesnt include who logged in 2009-05-02 15:30:00, etc...
>
> lastlogin between '2009-05-01' AND '2009-05-03'

Technically, BETWEEN is inclusive of the two values given so that
would also match '2009-05-03 00:00:00'.

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k






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

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: date ranges in where
Следующее
От: John R Pierce
Дата:
Сообщение: Re: XML -> PG ?