Common way to compare timestamp in oracle, postgres and SQL Server

Posted by Pratik on Stack Overflow See other posts from Stack Overflow or by Pratik
Published on 2010-03-24T04:43:14Z Indexed on 2010/03/25 1:13 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

I am writing a sql query which involves finding if timestamp falls in particular range of days.

I have written that in the postgres but it doesn't works in Oracle and SQL Server:

AND creation_date < (CURRENT_TIMESTAMP - interval '5 days')
AND creation_date >= (CURRENT_TIMESTAMP - interval '15 days')

Is there are common way to compare the timestamp across different databases?

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle