On Saturday 08 November 2003 9:04 am, Alex wrote: > Hi, > I want to remove data that is older that a certain number of > months.. only full months. > > example: today is 11-08 and I want do delete all data that is older > than this month - 3 month i.e. i want to delete all information > that is older than Aug. 1st.
select date_trunc('month', now()) - '3 months'::interval; ?column? ------------------------ 2003-08-01 00:00:00-07 Cheers, Steve ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match