Re: subtract a day from the NOW function

Поиск
Список
Период
Сортировка
От Fernando Hevia
Тема Re: subtract a day from the NOW function
Дата
Msg-id 011701c7a943$d9463b30$8f01010a@iptel.com.ar
обсуждение исходный текст
Ответ на Re: subtract a day from the NOW function  (Michael Glaesemann <grzm@seespotcode.net>)
Ответы Re: subtract a day from the NOW function  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-sql
>> B) SELECT * FROM some_table WHERE to_char(some_timestamp,  
>> 'YYYYMMDD') >
>> to_char((now() - interval '1 day'), 'YYYYMMDD');
>
>I'd never use to_char to compare dates. The built-in comparison  
>operators work just fine.
>

Why not? I'm curious if has anything to do with performance or just style?
Any difference between:  ... WHERE to_char(my_date_col:date, 'YYYY.MM.DD') < '2007.06.07'
and  ... WHERE my_date_col:date < '2007.06.07'

Is there a 3rd better way to do this comparison?




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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: subtract a day from the NOW function
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: subtract a day from the NOW function