I wanted to ask a simple question. Say I have a table with the timestamp
field. What is the best way to say get all the records that were created
say 2 hours before the query. One of the options would be to generate the
timestamp in the correct format and then send a query in the format SELECT * from <table> where create_time < <generated_timestamp>
Is there a better way than this?
Sure is:
SELECT * from <table> where create_time < (CURRENT_TIMESTAMP - INTERVAL '2 hours');
Chris
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend