Re: Compare an integer to now() - interval '3 days'

Поиск
Список
Период
Сортировка
От Szymon Guz
Тема Re: Compare an integer to now() - interval '3 days'
Дата
Msg-id AANLkTi=fBtJeFTo8Rd2EEE6Tk=57Kz3kCvrdEGWSxgbu@mail.gmail.com
обсуждение исходный текст
Ответ на Compare an integer to now() - interval '3 days'  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
On 11 March 2011 14:14, Alexander Farber <alexander.farber@gmail.com> wrote:

# select u.uid, u.name, u.created
from drupal_field_data_field_gender g, drupal_users u
where g.field_gender_value='Robot' and
u.uid=g.entity_id and u.created::timestamp > now() - interval '1 day';
ERROR:  cannot cast type integer to timestamp without time zone
LINE 4: u.uid=g.entity_id and u.created::timestamp > now() - interva...

What should I use instead of ::timestamp please?


Hi,
try this: 

    to_timestamp(u.created) 


regards
Szymon

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

Предыдущее
От: "David Johnston"
Дата:
Сообщение: Re: Compare an integer to now() - interval '3 days'
Следующее
От: Vibhor Kumar
Дата:
Сообщение: Re: Compare an integer to now() - interval '3 days'