12 mar 2010

Przycięcie pola typu data funkcją SUBSTRING

select
  t_add_date,
  SUBSTRING(t_add_date :: character varying, 1, 19)
from table
where
  t_add_date & lt;
NOW() - '1 DAY' :: interval t_add_date substring

2010-03-10 21:26:49.928445 2010-03-10 21:26:49
2010-03-10 21:26:49.928445 2010-03-10 21:26:49