I am trying a similar opperation of subtracting an interval from a timestamp, but I'm getting a syntax error when I try to add days or years into the Interval:
SELECT EXTRACT( SECOND FROM( TIMESTAMP '2008-06-01 00:00:10.000000' - CAST( '06-01 00:00:05' AS INTERVAL DAY TO SECOND)))
If there is a better way to do this, my goal is that I have 2 Timestamp fields in the format of 'YYYY-MM-DD HH:MM:SS.000000' where the zeroes are miliseconds. I'm looking to subtract the two timestamps and determine if at a precision of seconds the two timestamps are equal, or if not but how many seconds they are different. The above is a test to see if the syntax/algorithm of how I'm trying to do this works.