On Oct 25, 2004, at 11:54 AM, Larry Lennhoff wrote:
SELECT A.id FROM A JOIN B ON (join_col) WHERE built_on < now() - interval 'build_interval seconds';
It would help to see the error you're getting, but I suspect it has something to do with the fact that you're quoting 'build_interval'. Try something like WHERE built_on < current_timestamp - build_interval * INTERVAL '0.001 second';
(btw, current_timestamp is the SQL standard for now() )
Regards,
Michael Glaesemann grzm myrealbox com
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend